fshake3d
0.0.1
FreeformDensity3DSurfaceEditor
|
00001 #include "options.hpp" 00002 #include <iostream> 00003 using namespace std; 00004 void options_parser::usage() 00005 { 00006 cout << "usage: " << mArgv[0] << " [options]\n" 00007 << "\n" 00008 << " options:\n" 00009 #define OPTION(name,shortcut,args,description) << " -" << shortcut << " " << args << " " << description << "\n" 00010 #include "options_data.h" 00011 #undef OPTION 00012 ; 00013 } 00014 00015 void options_parser::parse_argument(options_config& c) 00016 { 00017 if ( mArgv[mPos][0] == '-' ) 00018 { 00019 switch( mArgv[mPos++][1] ) 00020 { 00021 #define OPTION(name,shortcut,args,description) case shortcut: c.name(*this); break; 00022 #include "options_data.h" 00023 #undef OPTION 00024 default: cerr << "options parse error: unknown argument " << mArgv[mPos-1] << "\n"; break; 00025 } 00026 } 00027 }