From dcd914665f6e8ea6ea4e648f7357f1c842273d87 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 29 Jun 2006 05:34:39 +0000 Subject: All done with all of the basic and some nice, extended functionality, now I just need to update our other projects... --- src/test/param.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/test') diff --git a/src/test/param.cpp b/src/test/param.cpp index 0641f90..a4d2824 100644 --- a/src/test/param.cpp +++ b/src/test/param.cpp @@ -3,12 +3,16 @@ Param::Param() { - addParam( "name", 's', mkproc( Param::printStuff ), &str ); + addHelpBanner("param - A test of the libbu++ parameter systems\n" + "Enjoy with care and caution\n\nTest stuff:\n"); + addParam( "name", 's', mkproc( Param::printStuff ), &str, "Test a param param" ); //addParam( "name", &str ); - addParam( "job", 'U', mkproc( Param::printStuff ) ); + addParam( "job", 'U', mkproc( Param::printStuff ), "Test a paramless param" ); - // --name=Bobo - // --job hello + addHelpBanner("\nInformational:\n"); + addParam( "help", mkproc( ParamProc::help ), "Help!" ); + + addHelpBanner("\nThanks for trying my test!\n\n"); } Param::~Param() @@ -30,11 +34,13 @@ int Param::printStuff( int argc, char *argv[] ) int main( int argc, char *argv[] ) { - printf("Starting...\n"); + if( argc == 1 ) + { + printf("You have to enter some parameter, try '--help'\n\n"); + return 0; + } + Param p; p.process( argc, argv ); - - //printf("Calling by hand...\n"); - //p.printStuff(); } -- cgit v1.2.3