diff options
author | Garrit Franke <garrit@slashdev.space> | 2022-03-31 23:27:09 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-31 15:57:10 -0700 |
commit | 6b52f48b8f1cda8d428d3e4fe685bd28713f293f (patch) | |
tree | a8f68b0291704318eefa5dbd6d3b91ae3997fdfe /Documentation/git.txt | |
parent | 4b6846d9dcd391164b72bd70e8a0c0e09776afe3 (diff) | |
download | git-6b52f48b8f1cda8d428d3e4fe685bd28713f293f.tar.gz |
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 'Documentation/git.txt')
-rw-r--r-- | Documentation/git.txt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Documentation/git.txt b/Documentation/git.txt index 13f83a2a3a..302607a496 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -9,7 +9,7 @@ git - the stupid content tracker SYNOPSIS -------- [verse] -'git' [--version] [--help] [-C <path>] [-c <name>=<value>] +'git' [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path] [-p|--paginate|-P|--no-pager] [--no-replace-objects] [--bare] [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>] @@ -39,6 +39,7 @@ or https://git-scm.com/docs. OPTIONS ------- +-v:: --version:: Prints the Git suite version that the 'git' program came from. + @@ -46,6 +47,7 @@ This option is internally converted to `git version ...` and accepts the same options as the linkgit:git-version[1] command. If `--help` is also given, it takes precedence over `--version`. +-h:: --help:: Prints the synopsis and a list of the most commonly used commands. If the option `--all` or `-a` is given then all |