Merge pull request #891 from saschagrunert/fish-hidden

Don't generate fish completion for hidden commands
main
Ajitem Sahasrabuddhe 5 years ago committed by GitHub
commit 388c2dd0f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -53,6 +53,9 @@ func testApp() *App {
Usage: "retrieve generic information",
}, {
Name: "some-command",
}, {
Name: "hidden-command",
Hidden: true,
}}
app.UsageText = "app [first_arg] [second_arg]"
app.Usage = "Some app"

@ -69,6 +69,10 @@ func (a *App) prepareFishCommands(commands []Command, allCommands *[]string, pre
for i := range commands {
command := &commands[i]
if command.Hidden {
continue
}
var completion strings.Builder
completion.WriteString(fmt.Sprintf(
"complete -r -c %s -n '%s' -a '%s'",

Loading…
Cancel
Save