From bd5bb1ca60a6a97b110cbf221b3625e6e6200141 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 26 May 2006 04:03:24 +0000 Subject: 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... --- src/test/params.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/test/params.cpp (limited to 'src/test') 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 @@ +#include +#include "pproc.h" + +int main( int argc, char *argv[] ) +{ + bool bOn = false; + bool bOff = true; + bool bTog = false; + char cChar = '?'; + PPROC table[] = { + { "boolon", 'n', PPROC_BOOL_TRUE, NULL, &bOn, + "Set the bool on." }, + { "booloff", 'f', PPROC_BOOL_FALSE, NULL, &bOff, + "Set the bool off." }, + { "booltog", 't', PPROC_BOOL_TOGGLE, NULL, &bTog, + "Set the bool off." }, + { "char", 'c', PPROC_CHAR, NULL, &cChar, + "Set the char." }, + { NULL, '\0', 0, NULL, NULL, NULL } + }; + + processParams( argc, argv, table ); + + printf("Final results:\n"); + printf("\tbOn = %s\n", (bOn ? "true" : "false") ); + printf("\tbOff = %s\n", (bOff ? "true" : "false") ); + printf("\tbTog = %s\n", (bTog ? "true" : "false") ); + printf("\tcChar = '%c'\n", cChar ); + + return 0; +} + -- cgit v1.2.3