Fix unit tests
This commit is contained in:
parent
9720ac029c
commit
50b52ca9d5
75
app_test.go
75
app_test.go
@ -1381,20 +1381,23 @@ func TestApp_VisibleCategories(t *testing.T) {
|
|||||||
app.HideHelp = true
|
app.HideHelp = true
|
||||||
app.Commands = []Command{
|
app.Commands = []Command{
|
||||||
{
|
{
|
||||||
Name: "command1",
|
Name: "command1",
|
||||||
Category: "1",
|
Category: "1",
|
||||||
HelpName: "foo command1",
|
HelpName: "foo command1",
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
|
FlagCategories: FlagCategories{},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "command2",
|
Name: "command2",
|
||||||
Category: "2",
|
Category: "2",
|
||||||
HelpName: "foo command2",
|
HelpName: "foo command2",
|
||||||
|
FlagCategories: FlagCategories{},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "command3",
|
Name: "command3",
|
||||||
Category: "3",
|
Category: "3",
|
||||||
HelpName: "foo command3",
|
HelpName: "foo command3",
|
||||||
|
FlagCategories: FlagCategories{},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1421,21 +1424,24 @@ func TestApp_VisibleCategories(t *testing.T) {
|
|||||||
app.HideHelp = true
|
app.HideHelp = true
|
||||||
app.Commands = []Command{
|
app.Commands = []Command{
|
||||||
{
|
{
|
||||||
Name: "command1",
|
Name: "command1",
|
||||||
Category: "1",
|
Category: "1",
|
||||||
HelpName: "foo command1",
|
HelpName: "foo command1",
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
|
FlagCategories: FlagCategories{},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "command2",
|
Name: "command2",
|
||||||
Category: "2",
|
Category: "2",
|
||||||
HelpName: "foo command2",
|
HelpName: "foo command2",
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
|
FlagCategories: FlagCategories{},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "command3",
|
Name: "command3",
|
||||||
Category: "3",
|
Category: "3",
|
||||||
HelpName: "foo command3",
|
HelpName: "foo command3",
|
||||||
|
FlagCategories: FlagCategories{},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1456,22 +1462,25 @@ func TestApp_VisibleCategories(t *testing.T) {
|
|||||||
app.HideHelp = true
|
app.HideHelp = true
|
||||||
app.Commands = []Command{
|
app.Commands = []Command{
|
||||||
{
|
{
|
||||||
Name: "command1",
|
Name: "command1",
|
||||||
Category: "1",
|
Category: "1",
|
||||||
HelpName: "foo command1",
|
HelpName: "foo command1",
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
|
FlagCategories: FlagCategories{},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "command2",
|
Name: "command2",
|
||||||
Category: "2",
|
Category: "2",
|
||||||
HelpName: "foo command2",
|
HelpName: "foo command2",
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
|
FlagCategories: FlagCategories{},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "command3",
|
Name: "command3",
|
||||||
Category: "3",
|
Category: "3",
|
||||||
HelpName: "foo command3",
|
HelpName: "foo command3",
|
||||||
Hidden: true,
|
Hidden: true,
|
||||||
|
FlagCategories: FlagCategories{},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
5
help.go
5
help.go
@ -54,12 +54,11 @@ CATEGORY:
|
|||||||
{{.Category}}{{end}}{{if .Description}}
|
{{.Category}}{{end}}{{if .Description}}
|
||||||
|
|
||||||
DESCRIPTION:
|
DESCRIPTION:
|
||||||
{{.Description}}{{end}}
|
{{.Description}}{{end}}{{if .VisibleFlagCategories}}
|
||||||
|
|
||||||
OPTIONS:{{range .VisibleFlagCategories}}
|
OPTIONS:{{range .VisibleFlagCategories}}
|
||||||
{{.Name}}
|
{{.Name}}
|
||||||
{{range .VisibleFlags}}{{.}}
|
{{range .VisibleFlags}}{{.}}
|
||||||
{{end}}{{end}}
|
{{end}}{{end}}{{end}}
|
||||||
`
|
`
|
||||||
|
|
||||||
// SubcommandHelpTemplate is the text template for the subcommand help topic.
|
// SubcommandHelpTemplate is the text template for the subcommand help topic.
|
||||||
|
Loading…
Reference in New Issue
Block a user