summaryrefslogtreecommitdiff
path: root/t/t1502-rev-parse-parseopt.sh
diff options
context:
space:
mode:
authorIlya Bobyr <ilya.bobyr@gmail.com>2014-03-22 09:47:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-03-24 00:28:03 (GMT)
commit9bab5b6061f1bc8ca54f8ac145f4f88c644e3bc4 (patch)
treeeaa52a5624ceb7be5177a4ffc2f809019865138b /t/t1502-rev-parse-parseopt.sh
parent3f09db07b3dc0758756fad73c96abd0e47cbcd1b (diff)
downloadgit-9bab5b6061f1bc8ca54f8ac145f4f88c644e3bc4.zip
git-9bab5b6061f1bc8ca54f8ac145f4f88c644e3bc4.tar.gz
git-9bab5b6061f1bc8ca54f8ac145f4f88c644e3bc4.tar.bz2
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-xt/t1502-rev-parse-parseopt.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t1502-rev-parse-parseopt.sh b/t/t1502-rev-parse-parseopt.sh
index 83b1300..960adf5 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