Merge pull request #1346 from jolheiser/hidden-flag
Exclude hidden sub-command flags from docs
This commit is contained in:
commit
924052a2f3
4
docs.go
4
docs.go
@ -80,14 +80,14 @@ func prepareCommands(commands []*Command, level int) []string {
|
|||||||
usageText,
|
usageText,
|
||||||
)
|
)
|
||||||
|
|
||||||
flags := prepareArgsWithValues(command.Flags)
|
flags := prepareArgsWithValues(command.VisibleFlags())
|
||||||
if len(flags) > 0 {
|
if len(flags) > 0 {
|
||||||
prepared += fmt.Sprintf("\n%s", strings.Join(flags, "\n"))
|
prepared += fmt.Sprintf("\n%s", strings.Join(flags, "\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
coms = append(coms, prepared)
|
coms = append(coms, prepared)
|
||||||
|
|
||||||
// recursevly iterate subcommands
|
// recursively iterate subcommands
|
||||||
if len(command.Subcommands) > 0 {
|
if len(command.Subcommands) > 0 {
|
||||||
coms = append(
|
coms = append(
|
||||||
coms,
|
coms,
|
||||||
|
@ -103,6 +103,11 @@ Should be a part of the same code block
|
|||||||
Aliases: []string{"s"},
|
Aliases: []string{"s"},
|
||||||
Usage: "some usage text",
|
Usage: "some usage text",
|
||||||
},
|
},
|
||||||
|
&StringFlag{
|
||||||
|
Name: "sub-command-hidden-flag",
|
||||||
|
Usage: "some hidden usage text",
|
||||||
|
Hidden: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Name: "sub-usage",
|
Name: "sub-usage",
|
||||||
Usage: "standard usage text",
|
Usage: "standard usage text",
|
||||||
|
2
fish.go
2
fish.go
@ -95,7 +95,7 @@ func (a *App) prepareFishCommands(commands []*Command, allCommands *[]string, pr
|
|||||||
completions = append(completions, completion.String())
|
completions = append(completions, completion.String())
|
||||||
completions = append(
|
completions = append(
|
||||||
completions,
|
completions,
|
||||||
a.prepareFishFlags(command.Flags, command.Names())...,
|
a.prepareFishFlags(command.VisibleFlags(), command.Names())...,
|
||||||
)
|
)
|
||||||
|
|
||||||
// recursevly iterate subcommands
|
// recursevly iterate subcommands
|
||||||
|
Loading…
Reference in New Issue
Block a user