summaryrefslogtreecommitdiff
path: root/src/options.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-02-08 10:52:30 -0700
committerMike Buland <eichlan@xagasoft.com>2012-02-08 10:52:30 -0700
commit105aa3262bde83a33394ec57401ecf53e8d81971 (patch)
tree14e2efb0410129551a3d2e895a11de0a1d6ff9d5 /src/options.cpp
parentb6a33cf4c6c66d364986d7f652c8574953fac4d9 (diff)
downloadstage-105aa3262bde83a33394ec57401ecf53e8d81971.tar.gz
stage-105aa3262bde83a33394ec57401ecf53e8d81971.tar.bz2
stage-105aa3262bde83a33394ec57401ecf53e8d81971.tar.xz
stage-105aa3262bde83a33394ec57401ecf53e8d81971.zip
Deflate support, more colors.
Diffstat (limited to 'src/options.cpp')
-rw-r--r--src/options.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/options.cpp b/src/options.cpp
index f8112c4..93a29bc 100644
--- a/src/options.cpp
+++ b/src/options.cpp
@@ -12,6 +12,8 @@
12#include <gats/gatsstream.h> 12#include <gats/gatsstream.h>
13#include <gats/types.h> 13#include <gats/types.h>
14 14
15#include <bu/deflate.h>
16
15#include "interfaceplugger.h" 17#include "interfaceplugger.h"
16 18
17using namespace Bu; 19using namespace Bu;
@@ -48,6 +50,8 @@ void Options::parse( int argc, char *argv[] )
48 50
49 opt.addOption( Bu::slot( this, &Options::smlTest ), "sml-test", 51 opt.addOption( Bu::slot( this, &Options::smlTest ), "sml-test",
50 "Test SML parser." ); 52 "Test SML parser." );
53 opt.addOption( Bu::slot( this, &Options::smlHelp ), "sml-help",
54 "Display SML help." );
51 opt.addOption( sCommand, "command", 55 opt.addOption( sCommand, "command",
52 "Set the command to execute once the game is loaded. " 56 "Set the command to execute once the game is loaded. "
53 "This does not work with all interfaces."); 57 "This does not work with all interfaces.");
@@ -124,6 +128,17 @@ int Options::smlTest( Bu::Array<Bu::String> aArgs )
124 return 0; 128 return 0;
125} 129}
126 130
131int Options::smlHelp( Bu::Array<Bu::String> aArgs )
132{
133 Bu::File fIn("sml-help.sml.gz", Bu::File::Read );
134 Bu::Deflate dIn( fIn );
135 char buf[4096];
136 buf[dIn.read( buf, 4096 )] = '\0';
137 printf("%s\n", buf );
138
139 return 0;
140}
141
127int Options::nonOption( Bu::Array<Bu::String> aArgs ) 142int Options::nonOption( Bu::Array<Bu::String> aArgs )
128{ 143{
129 sFile = aArgs[0]; 144 sFile = aArgs[0];