summaryrefslogtreecommitdiff
path: root/src/tests/optparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/optparser.cpp')
-rw-r--r--src/tests/optparser.cpp7
1 files changed, 6 insertions, 1 deletions
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
13{ 13{
14public: 14public:
15 Opts() : 15 Opts() :
16 iBob( 542 ) 16 iBob( 542 ),
17 bVal( false )
17 { 18 {
18 addHelpBanner("optparser - Test some option things..."); 19 addHelpBanner("optparser - Test some option things...");
19 20
@@ -41,11 +42,13 @@ public:
41 true 42 true
42 ); 43 );
43 addOption( sVar, 's', "str", "Set a variable, see what it does."); 44 addOption( sVar, 's', "str", "Set a variable, see what it does.");
45 addOption( bVal, 'b', "bool", "It's a thing.");
44 addOption( iBob, "bob", "Change iBob to whatever you want."); 46 addOption( iBob, "bob", "Change iBob to whatever you want.");
45 addOption( dBob, 'd', "Change dBob to whatever you want."); 47 addOption( dBob, 'd', "Change dBob to whatever you want.");
46 48
47 setOverride("str", "Bob!"); 49 setOverride("str", "Bob!");
48 setHelpDefault("bob", "=542"); 50 setHelpDefault("bob", "=542");
51 setOverride("bool", true );
49 52
50 addHelpOption(); 53 addHelpOption();
51 54
@@ -73,6 +76,7 @@ public:
73 int iBob; 76 int iBob;
74 float dBob; 77 float dBob;
75 Bu::String sVar; 78 Bu::String sVar;
79 bool bVal;
76}; 80};
77 81
78int main( int argc, char *argv[] ) 82int main( int argc, char *argv[] )
@@ -84,5 +88,6 @@ int main( int argc, char *argv[] )
84 sio << "sVar = \"" << o.sVar << "\"" << sio.nl; 88 sio << "sVar = \"" << o.sVar << "\"" << sio.nl;
85 sio << "iBob = " << o.iBob << sio.nl; 89 sio << "iBob = " << o.iBob << sio.nl;
86 sio << "dBob = " << o.dBob << sio.nl; 90 sio << "dBob = " << o.dBob << sio.nl;
91 sio << "bVal = " << o.bVal << sio.nl;
87} 92}
88 93