aboutsummaryrefslogtreecommitdiffstats
path: root/t/t1502
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2023-08-05 16:39:52 +0200
committerJunio C Hamano <gitster@pobox.com>2023-08-06 17:16:50 -0700
commitd5dc68f73041f95c1179fb092005e2326bdd8a7b (patch)
treef5b66c64e280d93d2bf232238d2dbf6af5d10c7c /t/t1502
parent8dcb49021e0134a1be1f533596e2bcf8313dea33 (diff)
downloadgit-d5dc68f73041f95c1179fb092005e2326bdd8a7b.tar.gz
t1502: test option negation
Add tests for checking the "git rev-parse --parseopt" flag "!" and whether options can be negated with a "no-" prefix. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1502')
-rw-r--r--t/t1502/optionspec-neg8
-rw-r--r--t/t1502/optionspec-neg.help11
2 files changed, 19 insertions, 0 deletions
diff --git a/t/t1502/optionspec-neg b/t/t1502/optionspec-neg
new file mode 100644
index 0000000000..392f43eb0b
--- /dev/null
+++ b/t/t1502/optionspec-neg
@@ -0,0 +1,8 @@
+some-command [options] <args>...
+
+some-command does foo and bar!
+--
+foo can be negated
+no-bar can be positivated
+positive-only! cannot be negated
+no-negative! cannot be positivated
diff --git a/t/t1502/optionspec-neg.help b/t/t1502/optionspec-neg.help
new file mode 100644
index 0000000000..54eba10afc
--- /dev/null
+++ b/t/t1502/optionspec-neg.help
@@ -0,0 +1,11 @@
+cat <<\EOF
+usage: some-command [options] <args>...
+
+ some-command does foo and bar!
+
+ --foo can be negated
+ --no-bar can be positivated
+ --positive-only cannot be negated
+ --no-negative cannot be positivated
+
+EOF