From 01f898ae6f293e9a4d094f5d2e0eb51f1b9a24aa Mon Sep 17 00:00:00 2001 From: mes5k Date: Mon, 24 Jan 2005 03:03:39 +0000 Subject: [PATCH] UnlabeledValueArg change --- examples/test2.cpp | 2 +- examples/test3.cpp | 4 ++-- examples/test6.cpp | 2 +- examples/test8.cpp | 8 ++++---- examples/test9.cpp | 6 ++++++ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/examples/test2.cpp b/examples/test2.cpp index ba2ea76..4f7627e 100644 --- a/examples/test2.cpp +++ b/examples/test2.cpp @@ -62,7 +62,7 @@ void parseOptions(int argc, char** argv) ValueArg ftest("f", "floatTest", "float test", false, 3.7, "float"); cmd.add( ftest ); - UnlabeledValueArg utest("unTest","unlabeld test", + UnlabeledValueArg utest("unTest","unlabeld test", true, "default","string"); cmd.add( utest ); diff --git a/examples/test3.cpp b/examples/test3.cpp index 3d31f94..d93fd0e 100644 --- a/examples/test3.cpp +++ b/examples/test3.cpp @@ -44,11 +44,11 @@ void parseOptions(int argc, char** argv) "string"); cmd.add( stest ); - UnlabeledValueArg utest("unTest1","unlabeled test one", + UnlabeledValueArg utest("unTest1","unlabeled test one", true, "default","string"); cmd.add( utest ); - UnlabeledValueArg ztest("unTest2","unlabeled test two", + UnlabeledValueArg ztest("unTest2","unlabeled test two", true, "default","string"); cmd.add( ztest ); diff --git a/examples/test6.cpp b/examples/test6.cpp index b0b2748..6cc31ea 100644 --- a/examples/test6.cpp +++ b/examples/test6.cpp @@ -31,7 +31,7 @@ int main(int argc, char** argv) iallowed.push_back(3); ValuesConstraint iallowedVals( iallowed ); - UnlabeledValueArg intArg("times","Number of times to print",1, + UnlabeledValueArg intArg("times","Number of times to print",true,1, &iallowedVals,false); cmd.add( intArg ); diff --git a/examples/test8.cpp b/examples/test8.cpp index daf8d00..08eee28 100644 --- a/examples/test8.cpp +++ b/examples/test8.cpp @@ -42,10 +42,10 @@ void parseOptions(int argc, char** argv) ValueArg stest("s", "stringTest", "string test", true, "homer", "string", cmd ); - UnlabeledValueArg utest("unTest1","unlabeled test one", + UnlabeledValueArg utest("unTest1","unlabeled test one", true, "default","string", cmd ); - UnlabeledValueArg ztest("unTest2","unlabeled test two", + UnlabeledValueArg ztest("unTest2","unlabeled test two", true, "default","string", cmd ); MultiArg itest("i", "intTest", "multi int test", false,"int", cmd ); @@ -53,8 +53,8 @@ void parseOptions(int argc, char** argv) MultiArg ftest("f", "floatTest", "multi float test", false,"float", cmd ); - UnlabeledMultiArg mtest("fileName","file names","fileNameString", - cmd); + UnlabeledMultiArg mtest("fileName","file names", + "fileNameString", cmd); // // Parse the command line. // diff --git a/examples/test9.cpp b/examples/test9.cpp index f3a0057..c30aa0d 100644 --- a/examples/test9.cpp +++ b/examples/test9.cpp @@ -21,6 +21,10 @@ int main(int argc, char** argv) MultiSwitchArg noise("N","noise","Level of noise",5); cmd.add( noise ); + UnlabeledValueArg word("word","a random word", false, "string", + "won't see this",false); + cmd.add( word ); + cmd.parse( argc, argv ); bool reverseName = reverseSwitch.getValue(); @@ -36,6 +40,8 @@ int main(int argc, char** argv) if ( noise.isSet() ) cout << "Noise level: " << noise.getValue() << endl; + if ( word.isSet() ) + cout << "Word: " << word.getValue() << endl; } catch (ArgException &e) // catch any exceptions { cerr << "error: " << e.error() << " for arg " << e.argId() << endl; }