diff options
author | Mike Buland <mike@xagasoft.com> | 2012-05-03 22:20:35 +0000 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2012-05-03 22:20:35 +0000 |
commit | 75b3ad661c2d6ed382620a25613846c2b2b10f46 (patch) | |
tree | 7f38d38adef79becf14df243b721bf5699e80245 /src | |
parent | 105aa3262bde83a33394ec57401ecf53e8d81971 (diff) | |
download | stage-75b3ad661c2d6ed382620a25613846c2b2b10f46.tar.gz stage-75b3ad661c2d6ed382620a25613846c2b2b10f46.tar.bz2 stage-75b3ad661c2d6ed382620a25613846c2b2b10f46.tar.xz stage-75b3ad661c2d6ed382620a25613846c2b2b10f46.zip |
Misc updates.
Diffstat (limited to 'src')
-rw-r--r-- | src/options.cpp | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/options.cpp b/src/options.cpp index 93a29bc..3fff4dc 100644 --- a/src/options.cpp +++ b/src/options.cpp | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <bu/sio.h> | 11 | #include <bu/sio.h> |
12 | #include <gats/gatsstream.h> | 12 | #include <gats/gatsstream.h> |
13 | #include <gats/types.h> | 13 | #include <gats/types.h> |
14 | #include "datafiles.h" | ||
14 | 15 | ||
15 | #include <bu/deflate.h> | 16 | #include <bu/deflate.h> |
16 | 17 | ||
@@ -108,7 +109,7 @@ int Options::smlTest( Bu::Array<Bu::String> aArgs ) | |||
108 | fIn.close(); | 109 | fIn.close(); |
109 | 110 | ||
110 | SmlNode *pRoot = SmlNode::parse( sContent ); | 111 | SmlNode *pRoot = SmlNode::parse( sContent ); |
111 | sio << *pRoot << sio.nl; | 112 | // sio << *pRoot << sio.nl; |
112 | 113 | ||
113 | try | 114 | try |
114 | { | 115 | { |
@@ -130,12 +131,24 @@ int Options::smlTest( Bu::Array<Bu::String> aArgs ) | |||
130 | 131 | ||
131 | int Options::smlHelp( Bu::Array<Bu::String> aArgs ) | 132 | int Options::smlHelp( Bu::Array<Bu::String> aArgs ) |
132 | { | 133 | { |
133 | Bu::File fIn("sml-help.sml.gz", Bu::File::Read ); | 134 | Bu::String sContent = Datafiles::getString("sml-help.sml"); |
134 | Bu::Deflate dIn( fIn ); | 135 | SmlNode *pRoot = SmlNode::parse( sContent ); |
135 | char buf[4096]; | 136 | |
136 | buf[dIn.read( buf, 4096 )] = '\0'; | 137 | try |
137 | printf("%s\n", buf ); | 138 | { |
139 | InterfacePlugger &ip = InterfacePlugger::getInstance(); | ||
140 | Interface *pIface = ip.instantiate( sInterface ); | ||
141 | pIface->display( pRoot ); | ||
142 | ip.destroy( pIface ); | ||
143 | } | ||
144 | catch( Bu::HashException &e ) | ||
145 | { | ||
146 | sio << "No such interface found." << sio.nl; | ||
147 | } | ||
148 | |||
149 | delete pRoot; | ||
138 | 150 | ||
151 | exit( 0 ); | ||
139 | return 0; | 152 | return 0; |
140 | } | 153 | } |
141 | 154 | ||