Skip to content

Commit

Permalink
bash: prevent no values warning when command has no flags
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Mar 27, 2020
1 parent 8951a0b commit cfc6e34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bash/snippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ func snippetFlagList(flags *pflag.FlagSet) string {
}
}
})
return ActionValues(flagValues...)
if len(flagValues) > 0 {
return ActionValues(flagValues...)
} else {
return ""
}
}

func snippetFlagCompletion(flag *pflag.Flag, action string) (snippet string) {
Expand Down

0 comments on commit cfc6e34

Please sign in to comment.