mirror of
https://github.com/spf13/cobra
synced 2025-05-06 13:27:26 +00:00
add helpCommand check to fish completions.
This commit is contained in:
parent
e949e84978
commit
65eca9e4ba
1 changed files with 1 additions and 2 deletions
|
@ -103,8 +103,7 @@ func subCommandPath(rootCmd *Command, cmd *Command) string {
|
||||||
|
|
||||||
func rangeCommands(cmd *Command, callback func(subCmd *Command)) {
|
func rangeCommands(cmd *Command, callback func(subCmd *Command)) {
|
||||||
for _, subCmd := range cmd.Commands() {
|
for _, subCmd := range cmd.Commands() {
|
||||||
// TODO: for merging to cobra: add || subCmd == cmd.helpCommand
|
if !subCmd.IsAvailableCommand() || subCmd == cmd.helpCommand {
|
||||||
if !subCmd.IsAvailableCommand() {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
callback(subCmd)
|
callback(subCmd)
|
||||||
|
|
Loading…
Add table
Reference in a new issue