From 6385780dc110bacf69a67332c8db8ddee9499eff Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 6 Apr 2012 22:21:57 +0000 Subject: The documentation includes the source again :-P --- src/tests/optparser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/tests/optparser.cpp') diff --git a/src/tests/optparser.cpp b/src/tests/optparser.cpp index aadb07c..4892942 100644 --- a/src/tests/optparser.cpp +++ b/src/tests/optparser.cpp @@ -13,7 +13,8 @@ class Opts : public Bu::OptParser { public: Opts() : - iBob( 542 ) + iBob( 542 ), + bVal( false ) { addHelpBanner("optparser - Test some option things..."); @@ -41,11 +42,13 @@ public: true ); addOption( sVar, 's', "str", "Set a variable, see what it does."); + addOption( bVal, 'b', "bool", "It's a thing."); addOption( iBob, "bob", "Change iBob to whatever you want."); addOption( dBob, 'd', "Change dBob to whatever you want."); setOverride("str", "Bob!"); setHelpDefault("bob", "=542"); + setOverride("bool", true ); addHelpOption(); @@ -73,6 +76,7 @@ public: int iBob; float dBob; Bu::String sVar; + bool bVal; }; int main( int argc, char *argv[] ) @@ -84,5 +88,6 @@ int main( int argc, char *argv[] ) sio << "sVar = \"" << o.sVar << "\"" << sio.nl; sio << "iBob = " << o.iBob << sio.nl; sio << "dBob = " << o.dBob << sio.nl; + sio << "bVal = " << o.bVal << sio.nl; } -- cgit v1.2.3