parseopt: add PARSE_OPT_NODASH
Add support for options that don't start with a dash. Initially, they don't accept arguments and can only be short options, i.e. consist of a single character. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
e0319ff5ed
commit
51a9949eda
@ -31,6 +31,7 @@ String options
|
||||
Magic arguments
|
||||
--quux means --quux
|
||||
-NUM set integer to NUM
|
||||
+ same as -b
|
||||
|
||||
Standard options
|
||||
--abbrev[=<n>] use <n> digits to display SHA-1s
|
||||
@ -276,6 +277,12 @@ test_expect_success 'OPT_NEGBIT() works' '
|
||||
test_cmp expect output
|
||||
'
|
||||
|
||||
test_expect_success 'OPT_BOOLEAN() with PARSE_OPT_NODASH works' '
|
||||
test-parse-options + + + + + + > output 2> output.err &&
|
||||
test ! -s output.err &&
|
||||
test_cmp expect output
|
||||
'
|
||||
|
||||
cat > expect <<EOF
|
||||
boolean: 0
|
||||
integer: 12345
|
||||
|
||||
Reference in New Issue
Block a user