diff --git a/examples/test2.cpp b/examples/test2.cpp index 4f7627e..8e0ebfe 100644 --- a/examples/test2.cpp +++ b/examples/test2.cpp @@ -66,7 +66,7 @@ void parseOptions(int argc, char** argv) "default","string"); cmd.add( utest ); - UnlabeledMultiArg mtest("fileName", "file names", "string"); + UnlabeledMultiArg mtest("fileName", "file names", false, "string"); cmd.add( mtest ); // diff --git a/examples/test3.cpp b/examples/test3.cpp index d93fd0e..89508fb 100644 --- a/examples/test3.cpp +++ b/examples/test3.cpp @@ -58,7 +58,8 @@ void parseOptions(int argc, char** argv) MultiArg ftest("f", "floatTest", "multi float test", false,"float" ); cmd.add( ftest ); - UnlabeledMultiArg mtest("fileName","file names","fileNameString"); + UnlabeledMultiArg mtest("fileName","file names",false, + "fileNameString"); cmd.add( mtest ); // // Parse the command line. diff --git a/examples/test7.cpp b/examples/test7.cpp index b4ab6de..d06edb8 100644 --- a/examples/test7.cpp +++ b/examples/test7.cpp @@ -30,7 +30,8 @@ int main(int argc, char** argv) iallowed.push_back(3); ValuesConstraint iiallowed( iallowed ); - UnlabeledMultiArg intArg("times","Number of times to print",&iiallowed); + UnlabeledMultiArg intArg("times","Number of times to print",false, + &iiallowed); cmd.add( intArg ); // Ignore the names and comments! These args mean nothing (to this diff --git a/examples/test8.cpp b/examples/test8.cpp index 08eee28..c31cc63 100644 --- a/examples/test8.cpp +++ b/examples/test8.cpp @@ -53,7 +53,7 @@ void parseOptions(int argc, char** argv) MultiArg ftest("f", "floatTest", "multi float test", false,"float", cmd ); - UnlabeledMultiArg mtest("fileName","file names", + UnlabeledMultiArg mtest("fileName","file names", false, "fileNameString", cmd); // // Parse the command line. diff --git a/examples/test9.cpp b/examples/test9.cpp index c30aa0d..f32fbe8 100644 --- a/examples/test9.cpp +++ b/examples/test9.cpp @@ -25,6 +25,13 @@ int main(int argc, char** argv) "won't see this",false); cmd.add( word ); + // Uncommenting the next arg will (correctly) cause an exception + // to be thrown. + +// UnlabeledMultiArg badword("badword","a bad word", false,"string"); +// +// cmd.add( badword ); + cmd.parse( argc, argv ); bool reverseName = reverseSwitch.getValue();