From dc0aa2daf3a8aec569c1fcd41903265ac8d72d08 Mon Sep 17 00:00:00 2001 From: mes5k Date: Wed, 11 Aug 2004 02:53:50 +0000 Subject: [PATCH] changed error output and added usage stuff --- tests/Makefile.am | 18 ++++++++++++++++-- tests/test10.out | 47 +++++------------------------------------------ tests/test11.out | 47 +++++------------------------------------------ tests/test12.out | 47 +++++------------------------------------------ tests/test15.out | 44 +++++--------------------------------------- tests/test16.out | 44 +++++--------------------------------------- tests/test17.out | 44 +++++--------------------------------------- tests/test18.out | 31 ++++--------------------------- tests/test22.out | 46 +++++----------------------------------------- tests/test23.out | 46 +++++----------------------------------------- tests/test24.out | 46 +++++----------------------------------------- tests/test26.out | 47 +++++------------------------------------------ tests/test27.out | 47 +++++------------------------------------------ tests/test28.out | 47 +++++------------------------------------------ tests/test29.out | 47 +++++------------------------------------------ tests/test30.out | 47 +++++------------------------------------------ tests/test31.out | 44 +++++--------------------------------------- tests/test32.out | 44 +++++--------------------------------------- tests/test35.out | 29 +++++------------------------ tests/test36.out | 29 +++++------------------------ tests/test38.out | 29 +++++------------------------ tests/test39.out | 29 +++++------------------------ tests/test4.out | 28 ++++------------------------ tests/test40.out | 26 ++++++++++++++++++++++++++ tests/test40.sh | 11 +++++++++++ tests/test41.out | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/test41.sh | 11 +++++++++++ tests/test42.out | 42 ++++++++++++++++++++++++++++++++++++++++++ tests/test42.sh | 11 +++++++++++ tests/test43.out | 29 +++++++++++++++++++++++++++++ tests/test43.sh | 11 +++++++++++ tests/test44.out | 44 ++++++++++++++++++++++++++++++++++++++++++++ tests/test44.sh | 11 +++++++++++ tests/test45.out | 28 ++++++++++++++++++++++++++++ tests/test45.sh | 11 +++++++++++ tests/test46.out | 32 ++++++++++++++++++++++++++++++++ tests/test46.sh | 11 +++++++++++ tests/test7.out | 7 ++++--- tests/test7.sh | 2 +- 39 files changed, 452 insertions(+), 807 deletions(-) create mode 100644 tests/test40.out create mode 100755 tests/test40.sh create mode 100644 tests/test41.out create mode 100755 tests/test41.sh create mode 100644 tests/test42.out create mode 100755 tests/test42.sh create mode 100644 tests/test43.out create mode 100755 tests/test43.sh create mode 100644 tests/test44.out create mode 100755 tests/test44.sh create mode 100644 tests/test45.out create mode 100755 tests/test45.sh create mode 100644 tests/test46.out create mode 100755 tests/test46.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 85a84fa..acd2912 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -38,7 +38,14 @@ TESTS = test1.sh \ test36.sh \ test37.sh \ test38.sh \ - test39.sh + test39.sh \ + test40.sh \ + test41.sh \ + test42.sh \ + test43.sh \ + test44.sh \ + test45.sh \ + test46.sh EXTRA_DIST = $(TESTS) \ test1.out \ @@ -79,5 +86,12 @@ EXTRA_DIST = $(TESTS) \ test36.out \ test37.out \ test38.out \ - test39.out + test39.out \ + test40.out \ + test41.out \ + test42.out \ + test43.out \ + test44.out \ + test45.out \ + test46.out diff --git a/tests/test10.out b/tests/test10.out index e21e65e..d68fb3e 100644 --- a/tests/test10.out +++ b/tests/test10.out @@ -1,47 +1,10 @@ PARSE ERROR: One or more required arguments missing! +Brief USAGE: + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... -USAGE: - - ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest - (value required) float test - - -i , --intTest - (required) (value required) integer test - - -s , --stringTest - (required) (value required) string test - - -A, --existTestA - tests for the existence of A - - -C, --existTestC - tests for the existence of C - - -B, --existTestB - tests for the existence of B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeld test - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test2 --help diff --git a/tests/test11.out b/tests/test11.out index 671980b..a9ccc4b 100644 --- a/tests/test11.out +++ b/tests/test11.out @@ -1,47 +1,10 @@ PARSE ERROR: Argument: -i (--intTest) Argument already set! +Brief USAGE: + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... -USAGE: - - ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest - (value required) float test - - -i , --intTest - (required) (value required) integer test - - -s , --stringTest - (required) (value required) string test - - -A, --existTestA - tests for the existence of A - - -C, --existTestC - tests for the existence of C - - -B, --existTestB - tests for the existence of B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeld test - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test2 --help diff --git a/tests/test12.out b/tests/test12.out index ebb0c02..7434099 100644 --- a/tests/test12.out +++ b/tests/test12.out @@ -1,47 +1,10 @@ PARSE ERROR: Argument: -f (--floatTest) Couldn't read argument value from string 'nine' +Brief USAGE: + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... -USAGE: - - ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest - (value required) float test - - -i , --intTest - (required) (value required) integer test - - -s , --stringTest - (required) (value required) string test - - -A, --existTestA - tests for the existence of A - - -C, --existTestC - tests for the existence of C - - -B, --existTestB - tests for the existence of B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeld test - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test2 --help diff --git a/tests/test15.out b/tests/test15.out index e08d894..eb8ae2f 100644 --- a/tests/test15.out +++ b/tests/test15.out @@ -1,44 +1,10 @@ PARSE ERROR: Argument: -s (--stringTest) Couldn't find delimiter for this argument! +Brief USAGE: + ../examples/test3 [-f=] ... [-i=] ... -s= [-B] + [--] [-v] [-h] ... -USAGE: - - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest (accepted multiple times) - (value required) multi float test - - -i , --intTest (accepted multiple times) - (value required) multi int test - - -s , --stringTest - (required) (value required) string test - - -B, --existTestB - exist Test B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeled test one - - - (required) (value required) unlabeled test two - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test3 --help diff --git a/tests/test16.out b/tests/test16.out index e08d894..eb8ae2f 100644 --- a/tests/test16.out +++ b/tests/test16.out @@ -1,44 +1,10 @@ PARSE ERROR: Argument: -s (--stringTest) Couldn't find delimiter for this argument! +Brief USAGE: + ../examples/test3 [-f=] ... [-i=] ... -s= [-B] + [--] [-v] [-h] ... -USAGE: - - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest (accepted multiple times) - (value required) multi float test - - -i , --intTest (accepted multiple times) - (value required) multi int test - - -s , --stringTest - (required) (value required) string test - - -B, --existTestB - exist Test B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeled test one - - - (required) (value required) unlabeled test two - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test3 --help diff --git a/tests/test17.out b/tests/test17.out index 905c244..60ee580 100644 --- a/tests/test17.out +++ b/tests/test17.out @@ -1,44 +1,10 @@ PARSE ERROR: One or more required arguments missing! +Brief USAGE: + ../examples/test3 [-f=] ... [-i=] ... -s= [-B] + [--] [-v] [-h] ... -USAGE: - - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest (accepted multiple times) - (value required) multi float test - - -i , --intTest (accepted multiple times) - (value required) multi int test - - -s , --stringTest - (required) (value required) string test - - -B, --existTestB - exist Test B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeled test one - - - (required) (value required) unlabeled test two - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test3 --help diff --git a/tests/test18.out b/tests/test18.out index d78cf86..b8167b9 100644 --- a/tests/test18.out +++ b/tests/test18.out @@ -1,32 +1,9 @@ PARSE ERROR: Argument: -*s Couldn't find match for argument +Brief USAGE: + ../examples/test4 [-A] [-B] -s [--] [-v] [-h] -USAGE: - - ../examples/test4 [-A] [-B] -s [--] [-v] [-h] - -Where: - - -A, --sA - exist Test B - - -B, --sB - exist Test B - - -s , --Bs - (required) (value required) string test - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - -this is a message +For complete USAGE and HELP type: + ../examples/test4 --help diff --git a/tests/test22.out b/tests/test22.out index 4cf585f..a466b50 100644 --- a/tests/test22.out +++ b/tests/test22.out @@ -1,46 +1,10 @@ PARSE ERROR: Argument: -b (--bbb) Argument already set! +Brief USAGE: + ../examples/test5 {-a |-b } {--eee |--fff + |-g } [--ddd] -c [--] [-v] [-h] -USAGE: - - ../examples/test5 {-a |-b } {--eee |--fff |-g } [--ddd] -c [--] [-v] [-h] - -Where: - - -a , --aaa - (OR required) (value required) or test a - -- OR -- - -b , --bbb - (OR required) (value required) or test b - - - --eee - (OR required) (value required) e test - -- OR -- - --fff - (OR required) (value required) f test - -- OR -- - -g , --ggg - (OR required) (value required) g test - - - --ddd - d test - - -c , --ccc - (required) (value required) c test - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - -this is a message +For complete USAGE and HELP type: + ../examples/test5 --help diff --git a/tests/test23.out b/tests/test23.out index 9893368..f4ed8e0 100644 --- a/tests/test23.out +++ b/tests/test23.out @@ -1,46 +1,10 @@ PARSE ERROR: Argument: -d Couldn't find match for argument +Brief USAGE: + ../examples/test5 {-a |-b } {--eee |--fff + |-g } [--ddd] -c [--] [-v] [-h] -USAGE: - - ../examples/test5 {-a |-b } {--eee |--fff |-g } [--ddd] -c [--] [-v] [-h] - -Where: - - -a , --aaa - (OR required) (value required) or test a - -- OR -- - -b , --bbb - (OR required) (value required) or test b - - - --eee - (OR required) (value required) e test - -- OR -- - --fff - (OR required) (value required) f test - -- OR -- - -g , --ggg - (OR required) (value required) g test - - - --ddd - d test - - -c , --ccc - (required) (value required) c test - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - -this is a message +For complete USAGE and HELP type: + ../examples/test5 --help diff --git a/tests/test24.out b/tests/test24.out index 4cf585f..a466b50 100644 --- a/tests/test24.out +++ b/tests/test24.out @@ -1,46 +1,10 @@ PARSE ERROR: Argument: -b (--bbb) Argument already set! +Brief USAGE: + ../examples/test5 {-a |-b } {--eee |--fff + |-g } [--ddd] -c [--] [-v] [-h] -USAGE: - - ../examples/test5 {-a |-b } {--eee |--fff |-g } [--ddd] -c [--] [-v] [-h] - -Where: - - -a , --aaa - (OR required) (value required) or test a - -- OR -- - -b , --bbb - (OR required) (value required) or test b - - - --eee - (OR required) (value required) e test - -- OR -- - --fff - (OR required) (value required) f test - -- OR -- - -g , --ggg - (OR required) (value required) g test - - - --ddd - d test - - -c , --ccc - (required) (value required) c test - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - -this is a message +For complete USAGE and HELP type: + ../examples/test5 --help diff --git a/tests/test26.out b/tests/test26.out index ad76e26..f6ae845 100644 --- a/tests/test26.out +++ b/tests/test26.out @@ -1,47 +1,10 @@ PARSE ERROR: Argument: -f (--floatTest) More than one valid value parsed from string '4..2' +Brief USAGE: + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... -USAGE: - - ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest - (value required) float test - - -i , --intTest - (required) (value required) integer test - - -s , --stringTest - (required) (value required) string test - - -A, --existTestA - tests for the existence of A - - -C, --existTestC - tests for the existence of C - - -B, --existTestB - tests for the existence of B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeld test - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test2 --help diff --git a/tests/test27.out b/tests/test27.out index 018531e..93dbe25 100644 --- a/tests/test27.out +++ b/tests/test27.out @@ -1,47 +1,10 @@ PARSE ERROR: Argument: -f (--floatTest) More than one valid value parsed from string '4.0.2' +Brief USAGE: + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... -USAGE: - - ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest - (value required) float test - - -i , --intTest - (required) (value required) integer test - - -s , --stringTest - (required) (value required) string test - - -A, --existTestA - tests for the existence of A - - -C, --existTestC - tests for the existence of C - - -B, --existTestB - tests for the existence of B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeld test - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test2 --help diff --git a/tests/test28.out b/tests/test28.out index 6a9e5bd..9c0637a 100644 --- a/tests/test28.out +++ b/tests/test28.out @@ -1,47 +1,10 @@ PARSE ERROR: Argument: -i (--intTest) Couldn't read argument value from string '2a' +Brief USAGE: + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... -USAGE: - - ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest - (value required) float test - - -i , --intTest - (required) (value required) integer test - - -s , --stringTest - (required) (value required) string test - - -A, --existTestA - tests for the existence of A - - -C, --existTestC - tests for the existence of C - - -B, --existTestB - tests for the existence of B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeld test - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test2 --help diff --git a/tests/test29.out b/tests/test29.out index 80a9ac4..de83f79 100644 --- a/tests/test29.out +++ b/tests/test29.out @@ -1,47 +1,10 @@ PARSE ERROR: Argument: -i (--intTest) Couldn't read argument value from string '0x2' +Brief USAGE: + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... -USAGE: - - ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest - (value required) float test - - -i , --intTest - (required) (value required) integer test - - -s , --stringTest - (required) (value required) string test - - -A, --existTestA - tests for the existence of A - - -C, --existTestC - tests for the existence of C - - -B, --existTestB - tests for the existence of B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeld test - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test2 --help diff --git a/tests/test30.out b/tests/test30.out index 3754267..bca1a65 100644 --- a/tests/test30.out +++ b/tests/test30.out @@ -1,47 +1,10 @@ PARSE ERROR: Argument: -i (--intTest) Couldn't read argument value from string '2.1' +Brief USAGE: + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... -USAGE: - - ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest - (value required) float test - - -i , --intTest - (required) (value required) integer test - - -s , --stringTest - (required) (value required) string test - - -A, --existTestA - tests for the existence of A - - -C, --existTestC - tests for the existence of C - - -B, --existTestB - tests for the existence of B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeld test - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test2 --help diff --git a/tests/test31.out b/tests/test31.out index cff1882..ac429f6 100644 --- a/tests/test31.out +++ b/tests/test31.out @@ -1,44 +1,10 @@ PARSE ERROR: Argument: -i (--intTest) Couldn't read argument value from string '9a' +Brief USAGE: + ../examples/test3 [-f=] ... [-i=] ... -s= [-B] + [--] [-v] [-h] ... -USAGE: - - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest (accepted multiple times) - (value required) multi float test - - -i , --intTest (accepted multiple times) - (value required) multi int test - - -s , --stringTest - (required) (value required) string test - - -B, --existTestB - exist Test B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeled test one - - - (required) (value required) unlabeled test two - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test3 --help diff --git a/tests/test32.out b/tests/test32.out index 0bb88fa..19ad1bc 100644 --- a/tests/test32.out +++ b/tests/test32.out @@ -1,44 +1,10 @@ PARSE ERROR: Argument: -f (--floatTest) More than one valid value parsed from string '1.0.0' +Brief USAGE: + ../examples/test3 [-f=] ... [-i=] ... -s= [-B] + [--] [-v] [-h] ... -USAGE: - - ../examples/test3 [-f=] ... [-i=] ... -s= [-B] [--] [-v] [-h] ... - -Where: - - -f , --floatTest (accepted multiple times) - (value required) multi float test - - -i , --intTest (accepted multiple times) - (value required) multi int test - - -s , --stringTest - (required) (value required) string test - - -B, --existTestB - exist Test B - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - (required) (value required) unlabeled test one - - - (required) (value required) unlabeled test two - - (accepted multiple times) - (value required) file names - - - -this is a message +For complete USAGE and HELP type: + ../examples/test3 --help diff --git a/tests/test35.out b/tests/test35.out index b244a84..6ecbbc1 100644 --- a/tests/test35.out +++ b/tests/test35.out @@ -1,29 +1,10 @@ PARSE ERROR: Argument: -n (--name) Couldn't find 'mike' in allowed list. +Brief USAGE: + ../examples/test6 -n [--] [-v] [-h] <1|2 + |3> -USAGE: - - ../examples/test6 -n [--] [-v] [-h] <1,2,3> - -Where: - - -n , --name - (required) (value required) Name to print - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - <1,2,3> - (required) (value required) Number of times to print - - - -Command description message +For complete USAGE and HELP type: + ../examples/test6 --help diff --git a/tests/test36.out b/tests/test36.out index 294e615..ef41e44 100644 --- a/tests/test36.out +++ b/tests/test36.out @@ -1,29 +1,10 @@ PARSE ERROR: Argument: (--times) Couldn't find '6' in allowed list. +Brief USAGE: + ../examples/test6 -n [--] [-v] [-h] <1|2 + |3> -USAGE: - - ../examples/test6 -n [--] [-v] [-h] <1,2,3> - -Where: - - -n , --name - (required) (value required) Name to print - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - <1,2,3> - (required) (value required) Number of times to print - - - -Command description message +For complete USAGE and HELP type: + ../examples/test6 --help diff --git a/tests/test38.out b/tests/test38.out index 76dcd99..b7e3234 100644 --- a/tests/test38.out +++ b/tests/test38.out @@ -1,29 +1,10 @@ PARSE ERROR: Argument: -n (--name) Couldn't find 'mike' in allowed list. +Brief USAGE: + ../examples/test7 -n ... [--] [-v] [-h] + <1|2|3> ... -USAGE: - - ../examples/test7 -n ... [--] [-v] [-h] <1,2,3> ... - -Where: - - -n , --name (accepted multiple times) - (required) (value required) Name to print - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - <1,2,3> (accepted multiple times) - (value required) Number of times to print - - - -Command description message +For complete USAGE and HELP type: + ../examples/test7 --help diff --git a/tests/test39.out b/tests/test39.out index 2b5d00e..ebb82b0 100644 --- a/tests/test39.out +++ b/tests/test39.out @@ -1,29 +1,10 @@ PARSE ERROR: Argument: (--times) Couldn't find '6' in allowed list. +Brief USAGE: + ../examples/test7 -n ... [--] [-v] [-h] + <1|2|3> ... -USAGE: - - ../examples/test7 -n ... [--] [-v] [-h] <1,2,3> ... - -Where: - - -n , --name (accepted multiple times) - (required) (value required) Name to print - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - <1,2,3> (accepted multiple times) - (value required) Number of times to print - - - -Command description message +For complete USAGE and HELP type: + ../examples/test7 --help diff --git a/tests/test4.out b/tests/test4.out index 7255994..2adc9ca 100644 --- a/tests/test4.out +++ b/tests/test4.out @@ -1,29 +1,9 @@ PARSE ERROR: One or more required arguments missing! +Brief USAGE: + ../examples/test1 [-u] -n [--] [-v] [-h] -USAGE: - - ../examples/test1 [-u] -n [--] [-v] [-h] - -Where: - - -u, --upperCase - Print in upper case - - -n , --name - (required) (value required) Name to print - - --, --ignore_rest - Ignores the rest of the labeled arguments following this flag. - - -v, --version - Displays version information and exits. - - -h, --help - Displays usage information and exits. - - - -Command description message +For complete USAGE and HELP type: + ../examples/test1 --help diff --git a/tests/test40.out b/tests/test40.out new file mode 100644 index 0000000..2ec49df --- /dev/null +++ b/tests/test40.out @@ -0,0 +1,26 @@ + +USAGE: + + ../examples/test1 [-u] -n [--] [-v] [-h] + + +Where: + + -u, --upperCase + Print in upper case + + -n , --name + (required) (value required) Name to print + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + Command description message + diff --git a/tests/test40.sh b/tests/test40.sh new file mode 100755 index 0000000..f2ec8d7 --- /dev/null +++ b/tests/test40.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test1 --help > tmp.out 2>&1 + +if cmp -s tmp.out test40.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test41.out b/tests/test41.out new file mode 100644 index 0000000..234269c --- /dev/null +++ b/tests/test41.out @@ -0,0 +1,45 @@ + +USAGE: + + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... + + +Where: + + -f , --floatTest + (value required) float test + + -i , --intTest + (required) (value required) integer test + + -s , --stringTest + (required) (value required) string test + + -A, --existTestA + tests for the existence of A + + -C, --existTestC + tests for the existence of C + + -B, --existTestB + tests for the existence of B + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + (required) (value required) unlabeld test + + (accepted multiple times) + (value required) file names + + + this is a message + diff --git a/tests/test41.sh b/tests/test41.sh new file mode 100755 index 0000000..04fb39d --- /dev/null +++ b/tests/test41.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test2 --help > tmp.out 2>&1 + +if cmp -s tmp.out test41.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test42.out b/tests/test42.out new file mode 100644 index 0000000..599be12 --- /dev/null +++ b/tests/test42.out @@ -0,0 +1,42 @@ + +USAGE: + + ../examples/test3 [-f=] ... [-i=] ... -s= [-B] + [--] [-v] [-h] ... + + +Where: + + -f , --floatTest (accepted multiple times) + (value required) multi float test + + -i , --intTest (accepted multiple times) + (value required) multi int test + + -s , --stringTest + (required) (value required) string test + + -B, --existTestB + exist Test B + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + (required) (value required) unlabeled test one + + + (required) (value required) unlabeled test two + + (accepted multiple times) + (value required) file names + + + this is a message + diff --git a/tests/test42.sh b/tests/test42.sh new file mode 100755 index 0000000..9c0a40a --- /dev/null +++ b/tests/test42.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test3 --help > tmp.out 2>&1 + +if cmp -s tmp.out test42.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test43.out b/tests/test43.out new file mode 100644 index 0000000..25ad3f3 --- /dev/null +++ b/tests/test43.out @@ -0,0 +1,29 @@ + +USAGE: + + ../examples/test4 [-A] [-B] -s [--] [-v] [-h] + + +Where: + + -A, --sA + exist Test B + + -B, --sB + exist Test B + + -s , --Bs + (required) (value required) string test + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + this is a message + diff --git a/tests/test43.sh b/tests/test43.sh new file mode 100755 index 0000000..ab7ac28 --- /dev/null +++ b/tests/test43.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test4 --help > tmp.out 2>&1 + +if cmp -s tmp.out test43.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test44.out b/tests/test44.out new file mode 100644 index 0000000..9a09da7 --- /dev/null +++ b/tests/test44.out @@ -0,0 +1,44 @@ + +USAGE: + + ../examples/test5 {-a |-b } {--eee |--fff + |-g } [--ddd] -c [--] [-v] [-h] + + +Where: + + -a , --aaa + (OR required) (value required) or test a + -- OR -- + -b , --bbb + (OR required) (value required) or test b + + + --eee + (OR required) (value required) e test + -- OR -- + --fff + (OR required) (value required) f test + -- OR -- + -g , --ggg + (OR required) (value required) g test + + + --ddd + d test + + -c , --ccc + (required) (value required) c test + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + + this is a message + diff --git a/tests/test44.sh b/tests/test44.sh new file mode 100755 index 0000000..5e1c26b --- /dev/null +++ b/tests/test44.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test5 --help > tmp.out 2>&1 + +if cmp -s tmp.out test44.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test45.out b/tests/test45.out new file mode 100644 index 0000000..5a764e8 --- /dev/null +++ b/tests/test45.out @@ -0,0 +1,28 @@ + +USAGE: + + ../examples/test6 -n [--] [-v] [-h] <1|2 + |3> + + +Where: + + -n , --name + (required) (value required) Name to print + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + <1|2|3> + (required) (value required) Number of times to print + + + Command description message + diff --git a/tests/test45.sh b/tests/test45.sh new file mode 100755 index 0000000..5bb7d1c --- /dev/null +++ b/tests/test45.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test6 --help > tmp.out 2>&1 + +if cmp -s tmp.out test45.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test46.out b/tests/test46.out new file mode 100644 index 0000000..da55835 --- /dev/null +++ b/tests/test46.out @@ -0,0 +1,32 @@ + +USAGE: + + ../examples/test7 -n ... [--] [-v] [-h] + <1|2|3> ... + + +Where: + + -n , --name (accepted multiple times) + (required) (value required) Name to print. This is a long, + nonsensical message to test line wrapping. Hopefully it works. + + --, --ignore_rest + Ignores the rest of the labeled arguments following this flag. + + -v, --version + Displays version information and exits. + + -h, --help + Displays usage information and exits. + + <1|2|3> (accepted multiple times) + (value required) Number of times to print + + + Command description message. This is a long multi-line message meant to + test line wrapping. This is more text that doesn't really do anything + besides take up lots of space that otherwise might be used for something + real. That should be enough, don't you think? + diff --git a/tests/test46.sh b/tests/test46.sh new file mode 100755 index 0000000..fb490cd --- /dev/null +++ b/tests/test46.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# success +../examples/test7 --help > tmp.out 2>&1 + +if cmp -s tmp.out test46.out; then + exit 0 +else + exit 1 +fi + diff --git a/tests/test7.out b/tests/test7.out index 815ee2c..234269c 100644 --- a/tests/test7.out +++ b/tests/test7.out @@ -1,7 +1,9 @@ USAGE: - ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] [-v] [-h] ... + ../examples/test2 [-f ] -i -s [-A] [-C] [-B] [--] + [-v] [-h] ... + Where: @@ -39,6 +41,5 @@ Where: (value required) file names - -this is a message + this is a message diff --git a/tests/test7.sh b/tests/test7.sh index 6772823..5af959a 100755 --- a/tests/test7.sh +++ b/tests/test7.sh @@ -1,6 +1,6 @@ #!/bin/sh -# failure +# success ../examples/test2 -i 10 -s hello goodbye -hABC > tmp.out 2>&1 if cmp -s tmp.out test7.out; then