Merge pull request #891 from saschagrunert/fish-hidden
Don't generate fish completion for hidden commands
This commit is contained in:
commit
388c2dd0f4
@ -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"
|
||||
|
4
fish.go
4
fish.go
@ -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…
Reference in New Issue
Block a user