#include "options.h" #include "version.h" #include #include #include using namespace Bu; Options::Options() { } Options::~Options() { } void Options::parse( int argc, char *argv[] ) { Bu::OptParser opt; opt.addHelpBanner("STAGE v" VERSION " - Simple, Textual, Adventure Game Environment"); opt.addHelpBanner("usage: " + Bu::String(argv[0]) + " [options] \n"); opt.addOption( Bu::slot( this, &Options::version ), Bu::String("version"), Bu::String("Show the version info.") ); opt.addHelpOption('h', "help"); opt.setNonOption( Bu::slot( this, &Options::nonOption ) ); opt.parse( argc, argv ); } int Options::version( Bu::StrArray aArgs ) { sio << "STAGE v" VERSION " - Simple, Textual, Adventure Game Environment." << sio.nl << sio.nl; sio << "Full version: " FULLVER << sio.nl; sio << "Build date: " TIMEVER << sio.nl; // sio << "Commit id: " SHAVER << sio.nl; sio << sio.nl; exit( 0 ); return 0; } int Options::nonOption( Bu::Array aArgs ) { sFile = aArgs[0]; return 0; }