diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/param.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/test/param.cpp b/src/test/param.cpp new file mode 100644 index 0000000..0641f90 --- /dev/null +++ b/src/test/param.cpp | |||
@@ -0,0 +1,40 @@ | |||
1 | #include "param.h" | ||
2 | #include <stdio.h> | ||
3 | |||
4 | Param::Param() | ||
5 | { | ||
6 | addParam( "name", 's', mkproc( Param::printStuff ), &str ); | ||
7 | //addParam( "name", &str ); | ||
8 | addParam( "job", 'U', mkproc( Param::printStuff ) ); | ||
9 | |||
10 | // --name=Bobo | ||
11 | // --job hello | ||
12 | } | ||
13 | |||
14 | Param::~Param() | ||
15 | { | ||
16 | } | ||
17 | |||
18 | int Param::printStuff( int argc, char *argv[] ) | ||
19 | { | ||
20 | printf("------------%02d-------------\n", argc ); | ||
21 | for( int j = 0; j < argc; j++ ) | ||
22 | { | ||
23 | printf("%d: %s\n", j, argv[j] ); | ||
24 | } | ||
25 | printf("---------------------------\n" ); | ||
26 | printf("SETVAR===\"%s\"\n", str.c_str() ); | ||
27 | |||
28 | return 1; | ||
29 | } | ||
30 | |||
31 | int main( int argc, char *argv[] ) | ||
32 | { | ||
33 | printf("Starting...\n"); | ||
34 | Param p; | ||
35 | p.process( argc, argv ); | ||
36 | |||
37 | //printf("Calling by hand...\n"); | ||
38 | //p.printStuff(); | ||
39 | } | ||
40 | |||