diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-06-19 12:38:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-19 12:38:45 -0700 |
commit | 50ad8561dee9d479e41586689486cbbb4a742f7b (patch) | |
tree | 41687648bc7b1674a109fdeb490b9b749f458fde /t/t0012-help.sh | |
parent | Merge branch 'ab/perf-remove-index-lock' (diff) | |
parent | t0012: test "-h" with builtins (diff) | |
download | tgif-50ad8561dee9d479e41586689486cbbb4a742f7b.tar.xz |
Merge branch 'jk/consistent-h'
"git $cmd -h" for builtin commands calls the implementation of the
command (i.e. cmd_$cmd() function) without doing any repository
set-up, and the commands that expect RUN_SETUP is done by the Git
potty needs to be prepared to show the help text without barfing.
* jk/consistent-h:
t0012: test "-h" with builtins
git: add hidden --list-builtins option
version: convert to parse-options
diff- and log- family: handle "git cmd -h" early
submodule--helper: show usage for "-h"
remote-{ext,fd}: print usage message on invalid arguments
upload-archive: handle "-h" option early
credential: handle invalid arguments earlier
Diffstat (limited to 't/t0012-help.sh')
-rwxr-xr-x | t/t0012-help.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t0012-help.sh b/t/t0012-help.sh index 8faba2e8bc..487b92a5de 100755 --- a/t/t0012-help.sh +++ b/t/t0012-help.sh @@ -49,4 +49,16 @@ test_expect_success "--help does not work for guides" " test_i18ncmp expect actual " +test_expect_success 'generate builtin list' ' + git --list-builtins >builtins +' + +while read builtin +do + test_expect_success "$builtin can handle -h" ' + test_expect_code 129 git $builtin -h >output 2>&1 && + test_i18ngrep usage output + ' +done <builtins + test_done |