Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-21 22:38:50 +0300
committerJunio C Hamano <gitster@pobox.com>2022-02-24 00:41:37 +0300
commit503cddacb63b9a37d063de5b11ac188de822e06f (patch)
treea29bf3320d0a3f0d3e91fdf071d8a4f31b01599b /t/t0012-help.sh
parent5e8068b74df8d0c58042a3ffe1c09dbffbbc63f7 (diff)
help: error if [-a|-g|-c] and [-i|-m|-w] are combined
Add more sanity checking to "git help" usage by erroring out if these man viewer options are combined with incompatible command-modes that will never use these documentation viewers. This continues the work started in d35d03cf93e (help: simplify by moving to OPT_CMDMODE(), 2021-09-22) of adding more sanity checking to "git help". Doing this allows us to clarify the "SYNOPSIS" in the documentation, and the "git help -h" output. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0012-help.sh')
-rwxr-xr-xt/t0012-help.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index c87730aa92..f12783fd15 100755
--- a/t/t0012-help.sh
+++ b/t/t0012-help.sh
@@ -49,6 +49,16 @@ test_expect_success 'invalid usage' '
test_expect_code 129 git help --config-sections-for-completion add
'
+for opt in '-a' '-g' '-c' '--config-for-completion' '--config-sections-for-completion'
+do
+ test_expect_success "invalid usage of '$opt' with [-i|-m|-w]" '
+ git help $opt &&
+ test_expect_code 129 git help $opt -i &&
+ test_expect_code 129 git help $opt -m &&
+ test_expect_code 129 git help $opt -w
+ '
+done
+
test_expect_success "works for commands and guides by default" '
configure_help &&
git help status &&