aboutsummaryrefslogtreecommitdiff
path: root/src/old/tests/param.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-07-03 00:28:59 +0000
committerMike Buland <eichlan@xagasoft.com>2007-07-03 00:28:59 +0000
commitac517a2b7625e0aa0862679e961c6349f859ea3b (patch)
treee3e27a6b9bd5e2be6150088495c91fc91786ad9d /src/old/tests/param.cpp
parentf8d4301e9fa4f3709258505941e37fab2eadadc6 (diff)
parentbd865cee5f89116c1f054cd0e5c275e97c2d0a9b (diff)
downloadlibbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.gz
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.bz2
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.tar.xz
libbu++-ac517a2b7625e0aa0862679e961c6349f859ea3b.zip
The reorg is being put in trunk, I think it's ready. Now we just get to find
out how many applications won't work anymore :)
Diffstat (limited to 'src/old/tests/param.cpp')
-rw-r--r--src/old/tests/param.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/old/tests/param.cpp b/src/old/tests/param.cpp
new file mode 100644
index 0000000..a4d2824
--- /dev/null
+++ b/src/old/tests/param.cpp
@@ -0,0 +1,46 @@
1#include "param.h"
2#include <stdio.h>
3
4Param::Param()
5{
6 addHelpBanner("param - A test of the libbu++ parameter systems\n"
7 "Enjoy with care and caution\n\nTest stuff:\n");
8 addParam( "name", 's', mkproc( Param::printStuff ), &str, "Test a param param" );
9 //addParam( "name", &str );
10 addParam( "job", 'U', mkproc( Param::printStuff ), "Test a paramless param" );
11
12 addHelpBanner("\nInformational:\n");
13 addParam( "help", mkproc( ParamProc::help ), "Help!" );
14
15 addHelpBanner("\nThanks for trying my test!\n\n");
16}
17
18Param::~Param()
19{
20}
21
22int Param::printStuff( int argc, char *argv[] )
23{
24 printf("------------%02d-------------\n", argc );
25 for( int j = 0; j < argc; j++ )
26 {
27 printf("%d: %s\n", j, argv[j] );
28 }
29 printf("---------------------------\n" );
30 printf("SETVAR===\"%s\"\n", str.c_str() );
31
32 return 1;
33}
34
35int main( int argc, char *argv[] )
36{
37 if( argc == 1 )
38 {
39 printf("You have to enter some parameter, try '--help'\n\n");
40 return 0;
41 }
42
43 Param p;
44 p.process( argc, argv );
45}
46