diff options
author | Garrit Franke <garrit@slashdev.space> | 2022-04-01 00:27:09 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-01 01:57:10 +0300 |
commit | 6b52f48b8f1cda8d428d3e4fe685bd28713f293f (patch) | |
tree | a8f68b0291704318eefa5dbd6d3b91ae3997fdfe /t/t0012-help.sh | |
parent | 4b6846d9dcd391164b72bd70e8a0c0e09776afe3 (diff) |
cli: add -v and -h shorthands
Change the behavior of "git -v" to be synonymous with "--version" /
"version", and "git -h" to be synonymous with "--help", but not "help".
These shorthands both display the "unknown option" message. Following
this change, "-v" displays the version, and "-h" displays the help text
of the "git" command.
It should be noted that the "-v" shorthand could be misinterpreted by
the user to mean "verbose" instead of "version", since some sub-commands
make use of it in this context. The top-level "git" command does not
have a "verbose" flag, so it's safe to introduce this shorthand
unambiguously.
Signed-off-by: Garrit Franke <garrit@slashdev.space>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0012-help.sh')
-rwxr-xr-x | t/t0012-help.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t0012-help.sh b/t/t0012-help.sh index 6c3e1f7159..6c33a43690 100755 --- a/t/t0012-help.sh +++ b/t/t0012-help.sh @@ -181,7 +181,7 @@ for cmd in git "git help" do test_expect_success "'$cmd' section spacing" ' test_section_spacing_trailer git help <<-\EOF && - usage: git [--version] [--help] [-C <path>] [-c <name>=<value>] + usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>] These are common Git commands used in various situations: |