1#!/bin/sh23test_description='help'45. ./test-lib.sh67configure_help () {8test_config help.format html &&910# Unless the path has "://" in it, Git tries to make sure11# the documentation directory locally exists. Avoid it as12# we are only interested in seeing an attempt to correctly13# invoke a help browser in this test.14test_config help.htmlpath test://html &&1516# Name a custom browser17test_config browser.test.cmd ./test-browser &&18test_config help.browser test19}2021test_expect_success "setup" '22# Just write out which page gets requested23write_script test-browser <<-\EOF24echo "$*" >test-browser.log25EOF26'2728test_expect_success "works for commands and guides by default" '29configure_help &&30git help status &&31echo "test://html/git-status.html" >expect &&32test_cmp expect test-browser.log &&33git help revisions &&34echo "test://html/gitrevisions.html" >expect &&35test_cmp expect test-browser.log36'3738test_expect_success "--exclude-guides does not work for guides" '39>test-browser.log &&40test_must_fail git help --exclude-guides revisions &&41test_must_be_empty test-browser.log42'4344test_expect_success "--help does not work for guides" "45cat <<-EOF >expect &&46git: 'revisions' is not a git command. See 'git --help'.47EOF48test_must_fail git revisions --help 2>actual &&49test_i18ncmp expect actual50"5152test_expect_success 'git help' '53git help >help.output &&54test_i18ngrep "^ clone " help.output &&55test_i18ngrep "^ add " help.output &&56test_i18ngrep "^ log " help.output &&57test_i18ngrep "^ commit " help.output &&58test_i18ngrep "^ fetch " help.output59'6061test_expect_success 'generate builtin list' '62git --list-builtins >builtins63'6465while read builtin66do67test_expect_success "$builtin can handle -h" '68test_expect_code 129 git $builtin -h >output 2>&1 &&69test_i18ngrep usage output70'71done <builtins7273test_done