diff options
author | Mike Buland <eichlan@xagasoft.com> | 2009-12-18 08:59:16 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2009-12-18 08:59:16 +0000 |
commit | 146930268a695dcc0432599d625ec3eb7e74025e (patch) | |
tree | a944d13981ed055b337757953014ed1e2d45e19c /src/tests/optparser.cpp | |
parent | 0d3d73fb0cacd3d1cf7eb8b83ba87f8b740b871a (diff) | |
download | libbu++-146930268a695dcc0432599d625ec3eb7e74025e.tar.gz libbu++-146930268a695dcc0432599d625ec3eb7e74025e.tar.bz2 libbu++-146930268a695dcc0432599d625ec3eb7e74025e.tar.xz libbu++-146930268a695dcc0432599d625ec3eb7e74025e.zip |
The OptParser still needs help banners and more helper functions, but otherwise,
it's done. It works great, and provides much flexibility and usefulness.
It now relies on the input side of the Formatter class, which at the moment
supports reading strings...not real useful yet...
Next up, adding readers for numbers and such, then it'll be mostly complete.
Also, fixed a bug when copying uninitialized signal objects.
Diffstat (limited to '')
-rw-r--r-- | src/tests/optparser.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tests/optparser.cpp b/src/tests/optparser.cpp index ee2ea58..5cf82bd 100644 --- a/src/tests/optparser.cpp +++ b/src/tests/optparser.cpp | |||
@@ -23,6 +23,8 @@ public: | |||
23 | o2.bShortHasParams = false; | 23 | o2.bShortHasParams = false; |
24 | o2.sHelp = "This is the second test parameter. It does not take parameters. However, I do want to make this part much longer to see how it looks when you add way too much text to one of these things. It can't really be that bad, right?"; | 24 | o2.sHelp = "This is the second test parameter. It does not take parameters. However, I do want to make this part much longer to see how it looks when you add way too much text to one of these things. It can't really be that bad, right?"; |
25 | addOption( o2 ); | 25 | addOption( o2 ); |
26 | |||
27 | addOption( 's', "str", sVar, "Set a variable, see what it does.", "bob!"); | ||
26 | 28 | ||
27 | addHelpOption('h', "help", "This help."); | 29 | addHelpOption('h', "help", "This help."); |
28 | } | 30 | } |
@@ -35,6 +37,7 @@ public: | |||
35 | } | 37 | } |
36 | 38 | ||
37 | int iBob; | 39 | int iBob; |
40 | Bu::FString sVar; | ||
38 | }; | 41 | }; |
39 | 42 | ||
40 | int main( int argc, char *argv[] ) | 43 | int main( int argc, char *argv[] ) |
@@ -42,5 +45,7 @@ int main( int argc, char *argv[] ) | |||
42 | Opts o; | 45 | Opts o; |
43 | 46 | ||
44 | o.parse( argc, argv ); | 47 | o.parse( argc, argv ); |
48 | |||
49 | sio << "sVar = \"" << o.sVar << "\"" << sio.nl; | ||
45 | } | 50 | } |
46 | 51 | ||