func BashCompletionLogLevel()

in flags/log.go [79:92]


func BashCompletionLogLevel(cmd *cobra.Command, f *pflag.FlagSet, name string) error {
	flag := f.Lookup(name)
	if flag == nil {
		return fmt.Errorf("%w: %q", ErrUndefined, name)
	}

	if _, ok := flag.Value.(*LogLevel); !ok {
		return fmt.Errorf("%w, want: level, got: %s", ErrInvalidType, flag.Value.Type())
	}

	fbody := fmt.Sprintf(fbodyLogLevel, strings.Join(LogLevelChoices(), " "))

	return utils.BashCompletion(cmd, f, name, fnameLogLevel, fbody)
}