From 8cb83eee5a58b1fad74c34094ce3afb9e430b5a4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 04:42:50 +0200 Subject: Adding upstream version 2.33.1. Signed-off-by: Daniel Baumann --- tests/expected/getopt/basic | 9 +++++++++ tests/expected/getopt/options-alternative_option_clash | 2 ++ tests/expected/getopt/options-alternative_option_long | 2 ++ tests/expected/getopt/options-alternative_option_short | 2 ++ tests/expected/getopt/options-compatible | 5 +++++ tests/expected/getopt/options-csh | 2 ++ tests/expected/getopt/options-invalid_getopt_option | 3 +++ tests/expected/getopt/options-invocation_model_one | 2 ++ tests/expected/getopt/options-invocation_model_three_as_one | 2 ++ tests/expected/getopt/options-invocation_model_two_as_one | 2 ++ tests/expected/getopt/options-invocation_without_parameters | 3 +++ tests/expected/getopt/options-long_option_ambiguous_1 | 3 +++ tests/expected/getopt/options-longopts | 2 ++ tests/expected/getopt/options-name_option_long | 4 ++++ tests/expected/getopt/options-name_option_short | 4 ++++ tests/expected/getopt/options-no-arguments | 3 +++ tests/expected/getopt/options-non-option | 4 ++++ tests/expected/getopt/options-posix_correctly | 4 ++++ tests/expected/getopt/options-quiet_option_long | 2 ++ tests/expected/getopt/options-quiet_option_short | 2 ++ tests/expected/getopt/options-quiet_output_option_long | 5 +++++ tests/expected/getopt/options-quiet_output_option_short | 5 +++++ tests/expected/getopt/options-same_long_short_options | 2 ++ tests/expected/getopt/options-sh | 2 ++ tests/expected/getopt/options-test_for_enhanced_getopt | 1 + tests/expected/getopt/options-unknown_options | 4 ++++ tests/expected/getopt/options-unquoted_option_bash | 5 +++++ tests/expected/getopt/options-unquoted_option_tcsh | 5 +++++ tests/expected/getopt/options-weird_quoting_bash | 5 +++++ tests/expected/getopt/options-weird_quoting_tcsh | 2 ++ 30 files changed, 98 insertions(+) create mode 100644 tests/expected/getopt/basic create mode 100644 tests/expected/getopt/options-alternative_option_clash create mode 100644 tests/expected/getopt/options-alternative_option_long create mode 100644 tests/expected/getopt/options-alternative_option_short create mode 100644 tests/expected/getopt/options-compatible create mode 100644 tests/expected/getopt/options-csh create mode 100644 tests/expected/getopt/options-invalid_getopt_option create mode 100644 tests/expected/getopt/options-invocation_model_one create mode 100644 tests/expected/getopt/options-invocation_model_three_as_one create mode 100644 tests/expected/getopt/options-invocation_model_two_as_one create mode 100644 tests/expected/getopt/options-invocation_without_parameters create mode 100644 tests/expected/getopt/options-long_option_ambiguous_1 create mode 100644 tests/expected/getopt/options-longopts create mode 100644 tests/expected/getopt/options-name_option_long create mode 100644 tests/expected/getopt/options-name_option_short create mode 100644 tests/expected/getopt/options-no-arguments create mode 100644 tests/expected/getopt/options-non-option create mode 100644 tests/expected/getopt/options-posix_correctly create mode 100644 tests/expected/getopt/options-quiet_option_long create mode 100644 tests/expected/getopt/options-quiet_option_short create mode 100644 tests/expected/getopt/options-quiet_output_option_long create mode 100644 tests/expected/getopt/options-quiet_output_option_short create mode 100644 tests/expected/getopt/options-same_long_short_options create mode 100644 tests/expected/getopt/options-sh create mode 100644 tests/expected/getopt/options-test_for_enhanced_getopt create mode 100644 tests/expected/getopt/options-unknown_options create mode 100644 tests/expected/getopt/options-unquoted_option_bash create mode 100644 tests/expected/getopt/options-unquoted_option_tcsh create mode 100644 tests/expected/getopt/options-weird_quoting_bash create mode 100644 tests/expected/getopt/options-weird_quoting_tcsh (limited to 'tests/expected/getopt') diff --git a/tests/expected/getopt/basic b/tests/expected/getopt/basic new file mode 100644 index 0000000..c2c90ae --- /dev/null +++ b/tests/expected/getopt/basic @@ -0,0 +1,9 @@ +Option a +Option b, argument `1' +Option c, argument `2' +Option a +Option b, argument `3' +Option c, no argument +Remaining arguments: +--> `foo' +--> `bar' diff --git a/tests/expected/getopt/options-alternative_option_clash b/tests/expected/getopt/options-alternative_option_clash new file mode 100644 index 0000000..04ae19d --- /dev/null +++ b/tests/expected/getopt/options-alternative_option_clash @@ -0,0 +1,2 @@ + -a --abcde --abcde -a -c -- +exit value: 0 diff --git a/tests/expected/getopt/options-alternative_option_long b/tests/expected/getopt/options-alternative_option_long new file mode 100644 index 0000000..0f5fc19 --- /dev/null +++ b/tests/expected/getopt/options-alternative_option_long @@ -0,0 +1,2 @@ + -a --one --two 'MANDATORY' --three 'OPTIONAL' -- +exit value: 0 diff --git a/tests/expected/getopt/options-alternative_option_short b/tests/expected/getopt/options-alternative_option_short new file mode 100644 index 0000000..0f5fc19 --- /dev/null +++ b/tests/expected/getopt/options-alternative_option_short @@ -0,0 +1,2 @@ + -a --one --two 'MANDATORY' --three 'OPTIONAL' -- +exit value: 0 diff --git a/tests/expected/getopt/options-compatible b/tests/expected/getopt/options-compatible new file mode 100644 index 0000000..66e42a7 --- /dev/null +++ b/tests/expected/getopt/options-compatible @@ -0,0 +1,5 @@ +getopt: missing optstring argument +Try 'getopt --help' for more information. +exit value: 2 + -- +exit value: 0 diff --git a/tests/expected/getopt/options-csh b/tests/expected/getopt/options-csh new file mode 100644 index 0000000..86e48f4 --- /dev/null +++ b/tests/expected/getopt/options-csh @@ -0,0 +1,2 @@ + -a -b '1' -c '2' --a-long --b-long '3' --c-long '' -- 'foo' 'bar' +exit value: 0 diff --git a/tests/expected/getopt/options-invalid_getopt_option b/tests/expected/getopt/options-invalid_getopt_option new file mode 100644 index 0000000..b3577e0 --- /dev/null +++ b/tests/expected/getopt/options-invalid_getopt_option @@ -0,0 +1,3 @@ +getopt: invalid option -- 'b' +Try 'getopt --help' for more information. +exit value: 2 diff --git a/tests/expected/getopt/options-invocation_model_one b/tests/expected/getopt/options-invocation_model_one new file mode 100644 index 0000000..ca4ddca --- /dev/null +++ b/tests/expected/getopt/options-invocation_model_one @@ -0,0 +1,2 @@ + -b -d -e OPTIONAL1 -f -a -c -ISREQUIRED -g BECOMES THREE ARGUMENTS -- ARG0 ARG1 NOT_OPTIONAL ARG2 ARG3 +exit value: 0 diff --git a/tests/expected/getopt/options-invocation_model_three_as_one b/tests/expected/getopt/options-invocation_model_three_as_one new file mode 100644 index 0000000..1d4701f --- /dev/null +++ b/tests/expected/getopt/options-invocation_model_three_as_one @@ -0,0 +1,2 @@ + -b -d '' -e 'OPTIONAL1' -f '' -a -c '-ISREQUIRED' -g 'BECOMES THREE ARGUMENTS' -- 'ARG0' 'ARG1' 'NOT_OPTIONAL' 'ARG2' 'ARG3' +exit value: 0 diff --git a/tests/expected/getopt/options-invocation_model_two_as_one b/tests/expected/getopt/options-invocation_model_two_as_one new file mode 100644 index 0000000..1d4701f --- /dev/null +++ b/tests/expected/getopt/options-invocation_model_two_as_one @@ -0,0 +1,2 @@ + -b -d '' -e 'OPTIONAL1' -f '' -a -c '-ISREQUIRED' -g 'BECOMES THREE ARGUMENTS' -- 'ARG0' 'ARG1' 'NOT_OPTIONAL' 'ARG2' 'ARG3' +exit value: 0 diff --git a/tests/expected/getopt/options-invocation_without_parameters b/tests/expected/getopt/options-invocation_without_parameters new file mode 100644 index 0000000..f1ecc16 --- /dev/null +++ b/tests/expected/getopt/options-invocation_without_parameters @@ -0,0 +1,3 @@ +getopt: missing optstring argument +Try 'getopt --help' for more information. +exit value: 2 diff --git a/tests/expected/getopt/options-long_option_ambiguous_1 b/tests/expected/getopt/options-long_option_ambiguous_1 new file mode 100644 index 0000000..c8cfbb3 --- /dev/null +++ b/tests/expected/getopt/options-long_option_ambiguous_1 @@ -0,0 +1,3 @@ +getopt: option '--long' is ambiguous; possibilities: '--long1' '--long2' + -- +exit value: 1 diff --git a/tests/expected/getopt/options-longopts b/tests/expected/getopt/options-longopts new file mode 100644 index 0000000..8ee9953 --- /dev/null +++ b/tests/expected/getopt/options-longopts @@ -0,0 +1,2 @@ + --long1 --thirdlong 'ARGUMENT' --secondlong 'ARG' --abbreviation 'ABBRARG' -a -- 'EXTRA1' +exit value: 0 diff --git a/tests/expected/getopt/options-name_option_long b/tests/expected/getopt/options-name_option_long new file mode 100644 index 0000000..60b9e6b --- /dev/null +++ b/tests/expected/getopt/options-name_option_long @@ -0,0 +1,4 @@ +THIS_PROGRAM: invalid option -- 'b' +THIS_PROGRAM: unrecognized option '--whatever' + --long -a -- +exit value: 1 diff --git a/tests/expected/getopt/options-name_option_short b/tests/expected/getopt/options-name_option_short new file mode 100644 index 0000000..60b9e6b --- /dev/null +++ b/tests/expected/getopt/options-name_option_short @@ -0,0 +1,4 @@ +THIS_PROGRAM: invalid option -- 'b' +THIS_PROGRAM: unrecognized option '--whatever' + --long -a -- +exit value: 1 diff --git a/tests/expected/getopt/options-no-arguments b/tests/expected/getopt/options-no-arguments new file mode 100644 index 0000000..f1ecc16 --- /dev/null +++ b/tests/expected/getopt/options-no-arguments @@ -0,0 +1,3 @@ +getopt: missing optstring argument +Try 'getopt --help' for more information. +exit value: 2 diff --git a/tests/expected/getopt/options-non-option b/tests/expected/getopt/options-non-option new file mode 100644 index 0000000..73f0b65 --- /dev/null +++ b/tests/expected/getopt/options-non-option @@ -0,0 +1,4 @@ + -a 'x' -- 'y' '-b' 'z' 'w' + -a 'x' -b 'z' -- 'y' 'w' + -a 'x' 'y' -b 'z' 'w' -- +exit value: 0 diff --git a/tests/expected/getopt/options-posix_correctly b/tests/expected/getopt/options-posix_correctly new file mode 100644 index 0000000..5b2bc33 --- /dev/null +++ b/tests/expected/getopt/options-posix_correctly @@ -0,0 +1,4 @@ + -a -b '1' -c '2' --a-long --b-long '3' --c-long '' -- 'foo' 'bar' 'xyxxy' '--a-long' +exit value: 0 + -a -b '1' -c '2' --a-long --b-long '3' --c-long '' -- 'foo' 'bar' 'xyxxy' '--a-long' +exit value: 0 diff --git a/tests/expected/getopt/options-quiet_option_long b/tests/expected/getopt/options-quiet_option_long new file mode 100644 index 0000000..3e1a967 --- /dev/null +++ b/tests/expected/getopt/options-quiet_option_long @@ -0,0 +1,2 @@ + -- +exit value: 1 diff --git a/tests/expected/getopt/options-quiet_option_short b/tests/expected/getopt/options-quiet_option_short new file mode 100644 index 0000000..3e1a967 --- /dev/null +++ b/tests/expected/getopt/options-quiet_option_short @@ -0,0 +1,2 @@ + -- +exit value: 1 diff --git a/tests/expected/getopt/options-quiet_output_option_long b/tests/expected/getopt/options-quiet_output_option_long new file mode 100644 index 0000000..3e05ca7 --- /dev/null +++ b/tests/expected/getopt/options-quiet_output_option_long @@ -0,0 +1,5 @@ +getopt: invalid option -- 'c' +getopt: unrecognized option '--unknown' +getopt: option '--long' is ambiguous; possibilities: '--long1' '--long2' +getopt: option requires an argument -- 'b' +exit value: 1 diff --git a/tests/expected/getopt/options-quiet_output_option_short b/tests/expected/getopt/options-quiet_output_option_short new file mode 100644 index 0000000..3e05ca7 --- /dev/null +++ b/tests/expected/getopt/options-quiet_output_option_short @@ -0,0 +1,5 @@ +getopt: invalid option -- 'c' +getopt: unrecognized option '--unknown' +getopt: option '--long' is ambiguous; possibilities: '--long1' '--long2' +getopt: option requires an argument -- 'b' +exit value: 1 diff --git a/tests/expected/getopt/options-same_long_short_options b/tests/expected/getopt/options-same_long_short_options new file mode 100644 index 0000000..919d227 --- /dev/null +++ b/tests/expected/getopt/options-same_long_short_options @@ -0,0 +1,2 @@ + -a --a -- +exit value: 0 diff --git a/tests/expected/getopt/options-sh b/tests/expected/getopt/options-sh new file mode 100644 index 0000000..86e48f4 --- /dev/null +++ b/tests/expected/getopt/options-sh @@ -0,0 +1,2 @@ + -a -b '1' -c '2' --a-long --b-long '3' --c-long '' -- 'foo' 'bar' +exit value: 0 diff --git a/tests/expected/getopt/options-test_for_enhanced_getopt b/tests/expected/getopt/options-test_for_enhanced_getopt new file mode 100644 index 0000000..539db06 --- /dev/null +++ b/tests/expected/getopt/options-test_for_enhanced_getopt @@ -0,0 +1 @@ +exit value: 4 diff --git a/tests/expected/getopt/options-unknown_options b/tests/expected/getopt/options-unknown_options new file mode 100644 index 0000000..6edba2b --- /dev/null +++ b/tests/expected/getopt/options-unknown_options @@ -0,0 +1,4 @@ +getopt: invalid option -- 'b' +getopt: unrecognized option '--whatever' + --long -a -- +exit value: 1 diff --git a/tests/expected/getopt/options-unquoted_option_bash b/tests/expected/getopt/options-unquoted_option_bash new file mode 100644 index 0000000..8da362f --- /dev/null +++ b/tests/expected/getopt/options-unquoted_option_bash @@ -0,0 +1,5 @@ + -a $?!* --long1 "\' -- More + than +one +line +exit value: 0 diff --git a/tests/expected/getopt/options-unquoted_option_tcsh b/tests/expected/getopt/options-unquoted_option_tcsh new file mode 100644 index 0000000..8da362f --- /dev/null +++ b/tests/expected/getopt/options-unquoted_option_tcsh @@ -0,0 +1,5 @@ + -a $?!* --long1 "\' -- More + than +one +line +exit value: 0 diff --git a/tests/expected/getopt/options-weird_quoting_bash b/tests/expected/getopt/options-weird_quoting_bash new file mode 100644 index 0000000..db871ce --- /dev/null +++ b/tests/expected/getopt/options-weird_quoting_bash @@ -0,0 +1,5 @@ + -a '$?!* ' --long1 '"\'\''' -- 'More + than +one +line' +exit value: 0 diff --git a/tests/expected/getopt/options-weird_quoting_tcsh b/tests/expected/getopt/options-weird_quoting_tcsh new file mode 100644 index 0000000..9e5b71d --- /dev/null +++ b/tests/expected/getopt/options-weird_quoting_tcsh @@ -0,0 +1,2 @@ + -a '$?'\!'*'\ '' --long1 '"\\'\''' -- 'More\n'\ 'than\none\nline' +exit value: 0 -- cgit v1.2.3