From 75b3ad661c2d6ed382620a25613846c2b2b10f46 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 3 May 2012 22:20:35 +0000 Subject: Misc updates. --- src/options.cpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src') 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 @@ #include #include #include +#include "datafiles.h" #include @@ -108,7 +109,7 @@ int Options::smlTest( Bu::Array aArgs ) fIn.close(); SmlNode *pRoot = SmlNode::parse( sContent ); - sio << *pRoot << sio.nl; +// sio << *pRoot << sio.nl; try { @@ -130,12 +131,24 @@ int Options::smlTest( Bu::Array aArgs ) int Options::smlHelp( Bu::Array aArgs ) { - Bu::File fIn("sml-help.sml.gz", Bu::File::Read ); - Bu::Deflate dIn( fIn ); - char buf[4096]; - buf[dIn.read( buf, 4096 )] = '\0'; - printf("%s\n", buf ); + Bu::String sContent = Datafiles::getString("sml-help.sml"); + SmlNode *pRoot = SmlNode::parse( sContent ); + + try + { + InterfacePlugger &ip = InterfacePlugger::getInstance(); + Interface *pIface = ip.instantiate( sInterface ); + pIface->display( pRoot ); + ip.destroy( pIface ); + } + catch( Bu::HashException &e ) + { + sio << "No such interface found." << sio.nl; + } + + delete pRoot; + exit( 0 ); return 0; } -- cgit v1.2.3