aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-02-26 00:14:22 -0800
committerJunio C Hamano <gitster@pobox.com>2008-02-26 00:14:22 -0800
commit2db511fdbdbe1c8aab80f4bc13f0df037bce8a33 (patch)
tree23350997a56089356ccaeaa923a783378c198bf6 /t
parentb8d97d07fd5025232cae74cfc9a555abd9ac390e (diff)
parent81fa145917c40b68a5e2cca6afc6a10cdfdbd25b (diff)
downloadgit-2db511fdbdbe1c8aab80f4bc13f0df037bce8a33.tar.gz
git-2db511fdbdbe1c8aab80f4bc13f0df037bce8a33.tar.xz
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
Diffstat (limited to 't')
-rwxr-xr-xt/t1502-rev-parse-parseopt.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
new file mode 100755
index 000000000..762af5faf
--- /dev/null
+++ b/t/t1502-rev-parse-parseopt.sh
@@ -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