aboutsummaryrefslogtreecommitdiff
path: root/src/test/params.cpp
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2006-05-26 04:03:24 +0000
committerMike Buland <eichlan@xagasoft.com>2006-05-26 04:03:24 +0000
commitbd5bb1ca60a6a97b110cbf221b3625e6e6200141 (patch)
tree063b1576b57aba698159f50a04461ddfb7c4dfb6 /src/test/params.cpp
parentbc6f456ef27bdf25bf7a7f677217b9b7204b4241 (diff)
downloadlibbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.tar.gz
libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.tar.bz2
libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.tar.xz
libbu++-bd5bb1ca60a6a97b110cbf221b3625e6e6200141.zip
Loads of updates to several systems, see each for what really changed, the
biggest are the updates to the exception framework, and to the pproc system, which is almost a competitor to popt already...
Diffstat (limited to '')
-rw-r--r--src/test/params.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/params.cpp b/src/test/params.cpp
new file mode 100644
index 0000000..7bd2c0c
--- /dev/null
+++ b/src/test/params.cpp
@@ -0,0 +1,32 @@
1#include <stdio.h>
2#include "pproc.h"
3
4int main( int argc, char *argv[] )
5{
6 bool bOn = false;
7 bool bOff = true;
8 bool bTog = false;
9 char cChar = '?';
10 PPROC table[] = {
11 { "boolon", 'n', PPROC_BOOL_TRUE, NULL, &bOn,
12 "Set the bool on." },
13 { "booloff", 'f', PPROC_BOOL_FALSE, NULL, &bOff,
14 "Set the bool off." },
15 { "booltog", 't', PPROC_BOOL_TOGGLE, NULL, &bTog,
16 "Set the bool off." },
17 { "char", 'c', PPROC_CHAR, NULL, &cChar,
18 "Set the char." },
19 { NULL, '\0', 0, NULL, NULL, NULL }
20 };
21
22 processParams( argc, argv, table );
23
24 printf("Final results:\n");
25 printf("\tbOn = %s\n", (bOn ? "true" : "false") );
26 printf("\tbOff = %s\n", (bOff ? "true" : "false") );
27 printf("\tbTog = %s\n", (bTog ? "true" : "false") );
28 printf("\tcChar = '%c'\n", cChar );
29
30 return 0;
31}
32