diff options
Diffstat (limited to 'src/tests/optparser.cpp')
-rw-r--r-- | src/tests/optparser.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/tests/optparser.cpp b/src/tests/optparser.cpp new file mode 100644 index 0000000..9168af8 --- /dev/null +++ b/src/tests/optparser.cpp | |||
@@ -0,0 +1,27 @@ | |||
1 | #include <bu/optparser.h> | ||
2 | #include <bu/sio.h> | ||
3 | using namespace Bu; | ||
4 | |||
5 | class Opts : public Bu::OptParser | ||
6 | { | ||
7 | public: | ||
8 | Opts() : | ||
9 | iBob( 542 ) | ||
10 | { | ||
11 | callback( this, &Opts::cb ); | ||
12 | } | ||
13 | |||
14 | int cb( int argc, char *argv[] ) | ||
15 | { | ||
16 | sio << "Hey, cb was called, here's a class var: " << iBob << sio.nl; | ||
17 | return 5; | ||
18 | } | ||
19 | |||
20 | int iBob; | ||
21 | }; | ||
22 | |||
23 | int main( int argc, char *argv[] ) | ||
24 | { | ||
25 | Opts o; | ||
26 | } | ||
27 | |||