diff options
author | Ilya Bobyr <ilya.bobyr@gmail.com> | 2014-03-22 02:47:34 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-23 17:28:03 -0700 |
commit | 9bab5b6061f1bc8ca54f8ac145f4f88c644e3bc4 (patch) | |
tree | eaa52a5624ceb7be5177a4ffc2f809019865138b /t/t1502-rev-parse-parseopt.sh | |
parent | 3f09db07b3dc0758756fad73c96abd0e47cbcd1b (diff) | |
download | git-9bab5b6061f1bc8ca54f8ac145f4f88c644e3bc4.tar.gz |
rev-parse --parseopt: option argument name hints
Built-in commands can specify names for option arguments when usage text
is generated for a command. sh based commands should be able to do the
same.
Option argument name hint is any text that comes after [*=?!] after the
argument name up to the first whitespace.
Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1502-rev-parse-parseopt.sh')
-rwxr-xr-x | t/t1502-rev-parse-parseopt.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh index 83b1300cef..960adf56af 100755 --- a/t/t1502-rev-parse-parseopt.sh +++ b/t/t1502-rev-parse-parseopt.sh @@ -18,6 +18,17 @@ 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 + Extras --extra1 line above used to cause a segfault but no longer does @@ -39,6 +50,15 @@ b,baz a short and long option 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 + Extras extra1 line above used to cause a segfault but no longer does EOF |