diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2012-02-25 23:14:54 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-02-27 03:32:53 +0400 |
commit | 0f1930c58754a821bd51087ca4676e6a69cd4d2b (patch) | |
tree | fa499d19a52980a2a7947e5235a188b813db1287 /t/t0040-parse-options.sh | |
parent | b9e63ddddc8928f39db6658bf6428a9b646e5ea5 (diff) |
parse-options: allow positivation of options starting, with no-
Long options can be negated by adding no- right after the leading
two dashes. This is useful e.g. to override options set by aliases.
For options that are defined to start with no- already, this looks
a bit funny. Allow such options to also be negated by removing the
prefix.
The following thirteen options are affected:
apply --no-add
bisect--helper --no-checkout
checkout-index --no-create
clone --no-checkout --no-hardlinks
commit --no-verify --no-post-rewrite
format-patch --no-binary
hash-object --no-filters
read-tree --no-sparse-checkout
revert --no-commit
show-branch --no-name
update-ref --no-deref
The following five are NOT affected because they are defined with
PARSE_OPT_NONEG or the non-negated version is defined as well:
branch --no-merged
format-patch --no-stat --no-numbered
update-index --no-assume-unchanged --no-skip-worktree
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0040-parse-options.sh')
-rwxr-xr-x | t/t0040-parse-options.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh index ca25e588ca..a44bcb9b39 100755 --- a/t/t0040-parse-options.sh +++ b/t/t0040-parse-options.sh @@ -107,7 +107,7 @@ test_expect_success 'OPT_BOOL() negation #2' 'check boolean: 0 -D --no-no-doubt' test_expect_success 'OPT_BOOL() no negation #1' 'check_unknown --fear' test_expect_success 'OPT_BOOL() no negation #2' 'check_unknown --no-no-fear' -test_expect_failure 'OPT_BOOL() positivation' 'check boolean: 0 -D --doubt' +test_expect_success 'OPT_BOOL() positivation' 'check boolean: 0 -D --doubt' cat > expect << EOF boolean: 2 |