diff --git a/bash/snippet.go b/bash/snippet.go index 2c999c469..174c3a2d1 100644 --- a/bash/snippet.go +++ b/bash/snippet.go @@ -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) {