mirror of
https://github.com/git/git.git
synced 2026-03-02 19:46:27 +00:00
Merge branch 'maint'
* maint: Documentation/git-am.txt: Pass -r in the example invocation of rm -f .dotest timezone_names[]: fixed the tz offset for New Zealand. filter-branch documentation: non-zero exit status in command abort the filter rev-parse: fix potential bus error with --parseopt option spec handling Use a single implementation and API for copy_file() Documentation/git-filter-branch: add a new msg-filter example Correct fast-export file mode strings to match fast-import standard
This commit is contained in:
43
t/t1502-rev-parse-parseopt.sh
Executable file
43
t/t1502-rev-parse-parseopt.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
|
||||
test_description='test git rev-parse --parseopt'
|
||||
. ./test-lib.sh
|
||||
|
||||
cat > expect.err <<EOF
|
||||
usage: some-command [options] <args>...
|
||||
|
||||
some-command does foo and bar!
|
||||
|
||||
-h, --help show the help
|
||||
--foo some nifty option --foo
|
||||
--bar ... some cool option --bar with an argument
|
||||
|
||||
An option group Header
|
||||
-C [...] option C with an optional argument
|
||||
|
||||
Extras
|
||||
--extra1 line above used to cause a segfault but no longer does
|
||||
|
||||
EOF
|
||||
|
||||
test_expect_success 'test --parseopt help output' '
|
||||
git rev-parse --parseopt -- -h 2> output.err <<EOF
|
||||
some-command [options] <args>...
|
||||
|
||||
some-command does foo and bar!
|
||||
--
|
||||
h,help show the help
|
||||
|
||||
foo some nifty option --foo
|
||||
bar= some cool option --bar with an argument
|
||||
|
||||
An option group Header
|
||||
C? option C with an optional argument
|
||||
|
||||
Extras
|
||||
extra1 line above used to cause a segfault but no longer does
|
||||
EOF
|
||||
git diff expect.err output.err
|
||||
'
|
||||
|
||||
test_done
|
||||
Reference in New Issue
Block a user