1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#include <bu/optparser.h> #include <bu/sio.h> using namespace Bu; class Opts : public Bu::OptParser { public: Opts() : iBob( 542 ) { callback( this, &Opts::cb ); } int cb( int argc, char *argv[] ) { sio << "Hey, cb was called, here's a class var: " << iBob << sio.nl; return 5; } int iBob; }; int main( int argc, char *argv[] ) { Opts o; }