Fix help tests with the introduction of -h

Commit c77deac080 in PR #83 added `h` as
the short flag for help, but the help tests were not updated. Update the
tests with the `-h` in the help output.
This commit is contained in:
Cam Hutchison
2020-06-01 21:43:09 +10:00
committed by Alec Thomas
parent c77deac080
commit b11ebc500b
+19 -19
View File
@@ -67,13 +67,13 @@ func TestHelp(t *testing.T) {
A test app. A test app.
Flags: Flags:
--help Show context-sensitive help. -h, --help Show context-sensitive help.
--string=STRING A string flag. --string=STRING A string flag.
--bool A bool flag with very long help that wraps a lot and is --bool A bool flag with very long help that wraps a lot
verbose and is really verbose. and is verbose and is really verbose.
--slice=STR,... A slice of strings. --slice=STR,... A slice of strings.
--map=KEY=VALUE;... A map of strings to ints. --map=KEY=VALUE;... A map of strings to ints.
--required A required flag. --required A required flag.
Commands: Commands:
one --required one --required
@@ -107,18 +107,18 @@ Sub-sub-arg.
Detailed help provided through the HelpProvider interface. Detailed help provided through the HelpProvider interface.
Flags: Flags:
--help Show context-sensitive help. -h, --help Show context-sensitive help.
--string=STRING A string flag. --string=STRING A string flag.
--bool A bool flag with very long help that wraps a lot and is --bool A bool flag with very long help that wraps a lot
verbose and is really verbose. and is verbose and is really verbose.
--slice=STR,... A slice of strings. --slice=STR,... A slice of strings.
--map=KEY=VALUE;... A map of strings to ints. --map=KEY=VALUE;... A map of strings to ints.
--required A required flag. --required A required flag.
--flag=STRING Nested flag under two. --flag=STRING Nested flag under two.
--required-two --required-two
--required-three --required-three
` `
t.Log(expected) t.Log(expected)
t.Log(w.String()) t.Log(w.String())
@@ -173,7 +173,7 @@ func TestHelpTree(t *testing.T) {
A test app. A test app.
Flags: Flags:
--help Show context-sensitive help. -h, --help Show context-sensitive help.
Commands: Commands:
one subcommand one one subcommand one
@@ -206,7 +206,7 @@ Run "test-app <command> --help" for more information on a command.
subcommand one subcommand one
Flags: Flags:
--help Show context-sensitive help. -h, --help Show context-sensitive help.
Commands: Commands:
thing subcommand thing thing subcommand thing