@@ -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
@@ -25,7 +25,7 @@ struct cmd_struct {
};
const char git_usage_string[] =
- N_("git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+ N_("git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
@@ -146,7 +146,10 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
* commands can be written with "--" prepended
* to make them look like flags.
*/
- if (!strcmp(cmd, "--help") || !strcmp(cmd, "--version"))
+ if (!strcmp(cmd, "-h") ||
+ !strcmp(cmd, "--help") ||
+ !strcmp(cmd, "-v") ||
+ !strcmp(cmd, "--version"))
break;
/*
@@ -893,7 +896,13 @@ int cmd_main(int argc, const char **argv)
handle_options(&argv, &argc, NULL);
if (argc > 0) {
/* translate --help and --version into commands */
- skip_prefix(argv[0], "--", &argv[0]);
+ if (!strcmp("-v", argv[0])) {
+ argv[0] = "version";
+ } else if (!strcmp("-h", argv[0])) {
+ argv[0] = "help";
+ } else {
+ skip_prefix(argv[0], "--", &argv[0]);
+ }
} else {
/* The user didn't specify a command; give them help */
commit_pager_choice();
@@ -24979,7 +24979,7 @@ msgstr "само за изчистване на грешки"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24987,7 +24987,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C ПЪТ] [-c ИМЕ=СТОЙНОСТ]\n"
+"git [-v | --version] [-h | --help] [-C ПЪТ] [-c ИМЕ=СТОЙНОСТ]\n"
" [--exec-path[=ПЪТ]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24451,14 +24451,14 @@ msgstr "només útil per a la depuració"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
@@ -24744,7 +24744,7 @@ msgstr "nur nützlich für Fehlersuche"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24752,7 +24752,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <Pfad>] [-c <Name>=<Wert>]\n"
+"git [-v | --version] [-h | --help] [-C <Pfad>] [-c <Name>=<Wert>]\n"
" [--exec-path[=<Pfad>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -18927,14 +18927,14 @@ msgstr ""
#: git.c:27
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <διαδρομή>] [-c <όνομα>=<τιμή>]\n"
+"git [-v | --version] [-h | --help] [-C <διαδρομή>] [-c <όνομα>=<τιμή>]\n"
" [--exec-path[=<διαδρομή>]] [--html-path] [--man-path] [--info-"
"path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
@@ -24475,7 +24475,7 @@ msgstr "solo útil para depurar"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24483,7 +24483,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <ruta>] [-c <nombre>=<valor>]\n"
+"git [-v | --version] [-h | --help] [-C <ruta>] [-c <nombre>=<valor>]\n"
" [--exec-path [= <path>]] [--html-path] [--man-path] [--info-"
"path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
@@ -24687,7 +24687,7 @@ msgstr "seulement utile pour le débogage"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24695,7 +24695,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <chemin>] [-c <nom>=<valeur>]\n"
+"git [-v | --version] [-h | --help] [-C <chemin>] [-c <nom>=<valeur>]\n"
" [--exec-path[=<chemin>]] [--html-path] [--man-path] [--info-"
"path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
@@ -22653,7 +22653,7 @@ msgstr ""
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -23740,7 +23740,7 @@ msgstr "hanya berguna untuk penirkutuan"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -23748,7 +23748,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <jalur>] [-c <nama>=<nilai>]\n"
+"git [-v | --version] [-h | --help] [-C <jalur>] [-c <nama>=<nilai>]\n"
" [--exec-path[=<jalur>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -23422,14 +23422,14 @@ msgstr "esci subito dopo aver annunciato le funzionalità"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <percorso>] [-c <nome>=<valore>]\n"
+"git [-v | --version] [-h | --help] [-C <percorso>] [-c <nome>=<valore>]\n"
" [--exec-path[=<percorso>]] [--html-path] [--man-path] [--info-"
"path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
@@ -15225,14 +15225,14 @@ msgstr "디버깅 메시지를 표준오류로 출력합니다"
#: git.c:27
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <경로>] [-c <이름>=<값>]\n"
+"git [-v | --version] [-h | --help] [-C <경로>] [-c <이름>=<값>]\n"
" [--exec-path[=<경로>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24406,7 +24406,7 @@ msgstr "przydatne tylko do odpluskwiania"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24414,7 +24414,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <ścieżka>] [-c <nazwa>=<wartość>]\n"
+"git [-v | --version] [-h | --help] [-C <ścieżka>] [-c <nazwa>=<wartość>]\n"
" [--exec-path[=<ścieżka>]] [--html-path] [--man-path] [--info-"
"path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
@@ -23666,7 +23666,7 @@ msgstr "apenas útil para depuração"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -21748,12 +21748,12 @@ msgstr ""
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n"
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
" <command> [<args>]"
-msgstr "git [--version] [--help] [-C <путь>] [-c <имя>=<значение>]\n [--exec-path[=<путь>]] [--html-path] [--man-path] [--info-path]\n [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n [--git-dir=<путь>] [--work-tree=<путь>] [--namespace=<имя>]\n <команда> [<аргументы>]"
+msgstr "git [-v | --version] [-h | --help] [-C <путь>] [-c <имя>=<значение>]\n [--exec-path[=<путь>]] [--html-path] [--man-path] [--info-path]\n [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n [--git-dir=<путь>] [--work-tree=<путь>] [--namespace=<имя>]\n <команда> [<аргументы>]"
#: git.c:35
msgid ""
@@ -24126,7 +24126,7 @@ msgstr "endast användbart vid felsökning"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24134,7 +24134,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <sökväg>] [-c <namn>=<värde>]\n"
+"git [-v | --version] [-h | --help] [-C <sökväg>] [-c <namn>=<värde>]\n"
" [--exec-path[=<sökväg>]] [--html-path] [--man-path] [--info-"
"path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
@@ -24215,7 +24215,7 @@ msgstr "yalnızca hata ayıklama için yararlı"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24223,7 +24223,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <yol>] [-c <ad>=<değer>]\n"
+"git [-v | --version] [-h | --help] [-C <yol>] [-c <ad>=<değer>]\n"
" [--exec-path[=<yol>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24290,7 +24290,7 @@ msgstr "chỉ hữu ích khi cần gỡ lỗi"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -24298,7 +24298,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C </đường/dẫn/>] [-c <tên>=<giá trị>]\n"
+"git [-v | --version] [-h | --help] [-C </đường/dẫn/>] [-c <tên>=<giá trị>]\n"
" [--exec-path[=</đường/dẫn/>]] [--html-path] [--man-path] [--info-"
"path]\n"
" [-p | --paginate | -P --no-pager] [--no-replace-objects] [--"
@@ -23838,7 +23838,7 @@ msgstr "只对调试有用"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -23846,7 +23846,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <路径>] [-c <名称>=<取值>]\n"
+"git [-v | --version] [-h | --help] [-C <路径>] [-c <名称>=<取值>]\n"
" [--exec-path[=<路径>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -23689,7 +23689,7 @@ msgstr "只對除錯有用"
#: git.c:28
msgid ""
-"git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
+"git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n"
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -23697,7 +23697,7 @@ msgid ""
" [--super-prefix=<path>] [--config-env=<name>=<envvar>]\n"
" <command> [<args>]"
msgstr ""
-"git [--version] [--help] [-C <路徑>] [-c <名稱>=<數值>]\n"
+"git [-v | --version] [-h | --help] [-C <路徑>] [-c <名稱>=<數值>]\n"
" [--exec-path[=<路徑>]] [--html-path] [--man-path] [--info-path]\n"
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--"
"bare]\n"
@@ -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:
If "-v" or "-h" is passed as a flag, they will be interpreted as a "version" or "help" command respectively. Signed-off-by: Garrit Franke <garrit@slashdev.space> --- I'm not sure if this was already discussed in the past or if there are reasons against this, but it would be quite handy if these shorthands existed for git. Since this is my first patch for this project, I'm very happy to take your feedback! Documentation/git.txt | 4 +++- git.c | 15 ++++++++++++--- po/bg.po | 4 ++-- po/ca.po | 4 ++-- po/de.po | 4 ++-- po/el.po | 4 ++-- po/es.po | 4 ++-- po/fr.po | 4 ++-- po/git.pot | 2 +- po/id.po | 4 ++-- po/it.po | 4 ++-- po/ko.po | 4 ++-- po/pl.po | 4 ++-- po/pt_PT.po | 2 +- po/ru.po | 4 ++-- po/sv.po | 4 ++-- po/tr.po | 4 ++-- po/vi.po | 4 ++-- po/zh_CN.po | 4 ++-- po/zh_TW.po | 4 ++-- t/t0012-help.sh | 2 +- 21 files changed, 50 insertions(+), 39 deletions(-)