help displays command names instead of usage in Available Commands

This commit is contained in:
Masahiro Sano
2015-02-11 18:20:29 +09:00
committed by spf13
parent 07a9dc0024
commit a16cb24999
2 changed files with 24 additions and 1 deletions

View File

@ -467,8 +467,16 @@ func TestRootHelp(t *testing.T) {
t.Errorf("--help shouldn't trigger an error, Got: \n %s", x.Output)
}
if strings.Contains(x.Output, cmdEcho.Use) {
t.Errorf("--help shouldn't display subcommand's usage, Got: \n %s", x.Output)
}
x = fullSetupTest("echo --help")
if strings.Contains(x.Output, cmdTimes.Use) {
t.Errorf("--help shouldn't display subsubcommand's usage, Got: \n %s", x.Output)
}
checkResultContains(t, x, "Available Commands:")
checkResultContains(t, x, "for more information about a command")