summaryrefslogtreecommitdiff
path: root/src/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/options.cpp')
-rw-r--r--src/options.cpp25
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
131int Options::smlHelp( Bu::Array<Bu::String> aArgs ) 132int 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