@@ -61,10 +61,6 @@ $ %[1]s completion zsh > "${fpath[1]}/_%[1]s"
61
61
}
62
62
}
63
63
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.
68
64
func (c CLI ) newFishCmd () * cobra.Command {
69
65
return & cobra.Command {
70
66
Use : "fish" ,
@@ -75,11 +71,10 @@ $ %[1]s completion fish | source
75
71
# To load completions for each session, execute once:
76
72
$ %[1]s completion fish > ~/.config/fish/completions/%[1]s.fish` , c .commandName ),
77
73
RunE : func (cmd * cobra.Command , cmdArgs []string ) error {
78
- return cmd.Root().GenFishCompletion(os.Stdout)
74
+ return cmd .Root ().GenFishCompletion (os .Stdout , true )
79
75
},
80
76
}
81
77
}
82
- */
83
78
84
79
func (CLI ) newPowerShellCmd () * cobra.Command {
85
80
return & cobra.Command {
@@ -102,7 +97,7 @@ Detailed instructions on how to do this for each shell are provided in their own
102
97
}
103
98
cmd .AddCommand (c .newBashCmd ())
104
99
cmd .AddCommand (c .newZshCmd ())
105
- // cmd.AddCommand(c.newFishCmd()) // TODO: uncomment when adding fish completion
100
+ cmd .AddCommand (c .newFishCmd ())
106
101
cmd .AddCommand (c .newPowerShellCmd ())
107
102
return cmd
108
103
}
0 commit comments