Skip to content

Commit e9caa6e

Browse files
authored
Merge pull request #2088 from Adirio/fish-code-completion
✨ Add fish completion
2 parents cd8812d + 23c49c2 commit e9caa6e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

pkg/cli/completion.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ $ %[1]s completion zsh > "${fpath[1]}/_%[1]s"
6161
}
6262
}
6363

64-
/* TODO: support fish code completion
65-
At the time this comment is written, the imported spf13.cobra version does not support fish completion.
66-
However, fish completion has been added to new spf13.cobra versions. When a new spf13.cobra version that
67-
supports it is used, uncomment this command and add it to the base completion command.
6864
func (c CLI) newFishCmd() *cobra.Command {
6965
return &cobra.Command{
7066
Use: "fish",
@@ -75,11 +71,10 @@ $ %[1]s completion fish | source
7571
# To load completions for each session, execute once:
7672
$ %[1]s completion fish > ~/.config/fish/completions/%[1]s.fish`, c.commandName),
7773
RunE: func(cmd *cobra.Command, cmdArgs []string) error {
78-
return cmd.Root().GenFishCompletion(os.Stdout)
74+
return cmd.Root().GenFishCompletion(os.Stdout, true)
7975
},
8076
}
8177
}
82-
*/
8378

8479
func (CLI) newPowerShellCmd() *cobra.Command {
8580
return &cobra.Command{
@@ -102,7 +97,7 @@ Detailed instructions on how to do this for each shell are provided in their own
10297
}
10398
cmd.AddCommand(c.newBashCmd())
10499
cmd.AddCommand(c.newZshCmd())
105-
// cmd.AddCommand(c.newFishCmd()) // TODO: uncomment when adding fish completion
100+
cmd.AddCommand(c.newFishCmd())
106101
cmd.AddCommand(c.newPowerShellCmd())
107102
return cmd
108103
}

0 commit comments

Comments
 (0)