summaryrefslogtreecommitdiffstats
path: root/tests/expected/getopt
diff options
context:
space:
mode:
authorKarel Zak2016-04-22 13:39:31 +0200
committerKarel Zak2016-04-22 13:39:31 +0200
commitb6782d869710557b1f2252c03dda23b5fa246ac3 (patch)
treec5ef59985d3651994ae2d70424a6f9c0ab64837a /tests/expected/getopt
parentmount: add note about loopdev reuse to mount.8 (diff)
downloadkernel-qcow2-util-linux-b6782d869710557b1f2252c03dda23b5fa246ac3.tar.gz
kernel-qcow2-util-linux-b6782d869710557b1f2252c03dda23b5fa246ac3.tar.xz
kernel-qcow2-util-linux-b6782d869710557b1f2252c03dda23b5fa246ac3.zip
tests: move getopt to separate directory
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/expected/getopt')
-rw-r--r--tests/expected/getopt/basic9
-rw-r--r--tests/expected/getopt/options-alternative_option_clash2
-rw-r--r--tests/expected/getopt/options-alternative_option_long2
-rw-r--r--tests/expected/getopt/options-alternative_option_short2
-rw-r--r--tests/expected/getopt/options-compatible5
-rw-r--r--tests/expected/getopt/options-csh2
-rw-r--r--tests/expected/getopt/options-invalid_getopt_option3
-rw-r--r--tests/expected/getopt/options-invocation_model_one2
-rw-r--r--tests/expected/getopt/options-invocation_model_three_as_one2
-rw-r--r--tests/expected/getopt/options-invocation_model_two_as_one2
-rw-r--r--tests/expected/getopt/options-invocation_without_parameters3
-rw-r--r--tests/expected/getopt/options-long_option_ambiguous_13
-rw-r--r--tests/expected/getopt/options-longopts2
-rw-r--r--tests/expected/getopt/options-name_option_long4
-rw-r--r--tests/expected/getopt/options-name_option_short4
-rw-r--r--tests/expected/getopt/options-no-arguments3
-rw-r--r--tests/expected/getopt/options-non-option4
-rw-r--r--tests/expected/getopt/options-posix_correctly4
-rw-r--r--tests/expected/getopt/options-quiet_option_long2
-rw-r--r--tests/expected/getopt/options-quiet_option_short2
-rw-r--r--tests/expected/getopt/options-quiet_output_option_long5
-rw-r--r--tests/expected/getopt/options-quiet_output_option_short5
-rw-r--r--tests/expected/getopt/options-same_long_short_options2
-rw-r--r--tests/expected/getopt/options-sh2
-rw-r--r--tests/expected/getopt/options-test_for_enhanced_getopt1
-rw-r--r--tests/expected/getopt/options-unknown_options4
-rw-r--r--tests/expected/getopt/options-unquoted_option_bash5
-rw-r--r--tests/expected/getopt/options-unquoted_option_tcsh5
-rw-r--r--tests/expected/getopt/options-weird_quoting_bash5
-rw-r--r--tests/expected/getopt/options-weird_quoting_tcsh2
30 files changed, 98 insertions, 0 deletions
diff --git a/tests/expected/getopt/basic b/tests/expected/getopt/basic
new file mode 100644
index 000000000..c2c90aeec
--- /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 000000000..04ae19de0
--- /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 000000000..0f5fc19c0
--- /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 000000000..0f5fc19c0
--- /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 000000000..585de608a
--- /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 000000000..86e48f4fe
--- /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 000000000..531cc9828
--- /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 000000000..ca4ddca90
--- /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 000000000..1d4701f5c
--- /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 000000000..1d4701f5c
--- /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 000000000..08b3ed5cf
--- /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 000000000..c8cfbb3d9
--- /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 000000000..379b5abc1
--- /dev/null
+++ b/tests/expected/getopt/options-longopts
@@ -0,0 +1,2 @@
+ --long1 --thirdlong 'ARGUMENT' --secondlong 'ARG' --abbriviation '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 000000000..60b9e6b7b
--- /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 000000000..60b9e6b7b
--- /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 000000000..08b3ed5cf
--- /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 000000000..73f0b659c
--- /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 000000000..5b2bc33fc
--- /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 000000000..3e1a9672a
--- /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 000000000..3e1a9672a
--- /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 000000000..3e05ca7df
--- /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 000000000..3e05ca7df
--- /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 000000000..919d2276b
--- /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 000000000..86e48f4fe
--- /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 000000000..539db061d
--- /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 000000000..6edba2b77
--- /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 000000000..8da362fe8
--- /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 000000000..8da362fe8
--- /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 000000000..db871ce13
--- /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 000000000..9e5b71da0
--- /dev/null
+++ b/tests/expected/getopt/options-weird_quoting_tcsh
@@ -0,0 +1,2 @@
+ -a '$?'\!'*'\ '' --long1 '"\\'\''' -- 'More\n'\ 'than\none\nline'
+exit value: 0