Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
t1502: move optionspec help output to a file
"git rev-parse --parseopt" shows the short help with its description of all recognized options twice: When called with -h or --help, and after reporting an unknown option. Move the one for optionspec into a file and use it in two tests to deduplicate that part. "git rev-parse --parseopt -- --h" wraps the help text in "cat <<\EOF" and "EOF". Keep that part in the file to use it as is in the test that needs it and simply remove it in the other one using sed. Disable whitespace checking for the file using an attribute, as we need to keep its spaces intact and wouldn't want a stray --whitespace=fix turn them into tabs. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
- Loading branch information
Showing
3 changed files
with
42 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* -whitespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
cat <<\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 | ||
-b, --baz a short and long option | ||
|
||
An option group Header | ||
-C[...] option C with an optional argument | ||
-d, --data[=...] short and long option with an optional argument | ||
|
||
Argument hints | ||
-B <arg> short option required argument | ||
--bar2 <arg> long option required argument | ||
-e, --fuz <with-space> | ||
short and long option required argument | ||
-s[<some>] short option optional argument | ||
--long[=<data>] long option optional argument | ||
-g, --fluf[=<path>] short and long option optional argument | ||
--longest <very-long-argument-hint> | ||
a very long argument hint | ||
--pair <key=value> with an equals sign in the hint | ||
--aswitch help te=t contains? fl*g characters!` | ||
--bswitch <hint> hint has trailing tab character | ||
--cswitch switch has trailing tab character | ||
--short-hint <a> with a one symbol hint | ||
|
||
Extras | ||
--extra1 line above used to cause a segfault but no longer does | ||
|
||
EOF |