// WithFlag adds flags to a plugin
340849
func WithFlag(flag ...cli.Flag) Option {
	return func(o *Options) {
		o.Flags = append(o.Flags, flag...)
	}
}
1119402
func (f *featureGate) AddFlag(fs *pflag.FlagSet) {
	f.lock.Lock()
	// TODO(mtaufen): Shouldn't we just close it on the first Set/SetFromMap instead?
	// Not all components expose a feature gates flag using this AddFlag method, and
	// in the future, all components will completely stop exposing a feature gates flag,
	// in favor of componentconfig.
	f.closed = true
	f.lock.Unlock()

	known := f.KnownFeatures()
	fs.Var(f, flagName, ""+
		"A set of key=value pairs that describe feature gates for alpha/experimental features. "+
		"Options are:\n"+strings.Join(known, "\n"))
}
252466
func WithoutFlag(args []string, flag string) []string {
	out := make([]string, 0, len(args))
	for i := 0; i < len(args); i += 1 {
		val := args[i]
		if !strings.HasPrefix(val, flag) {
			out = append(out, val)
		} else {
			if !strings.Contains(val, "=") && i+1 <= len(args)-1 {
				i += 1
			}
		}
	}
	return out
}
1241737
func (f *GenericFlag) ApplyWithError(set *flag.FlagSet) error {
	f.set = set
	return f.GenericFlag.ApplyWithError(set)
}
258571
func (f UintFlag) ApplyWithError(set *flag.FlagSet) error {
	if envVal, ok := flagFromFileEnv(f.FilePath, f.EnvVar); ok {
		envValInt, err := strconv.ParseUint(envVal, 0, 64)
		if err != nil {
			return fmt.Errorf("could not parse %s as uint value for flag %s: %s", envVal, f.Name, err)
		}

		f.Value = uint(envValInt)
	}

	eachName(f.Name, func(name string) {
		if f.Destination != nil {
			set.UintVar(f.Destination, name, f.Value, f.Usage)
			return
		}
		set.Uint(name, f.Value, f.Usage)
	})

	return nil
}
844393
func (d *Domain) CreateWithFlags(flags DomainCreateFlags) error {
	var err C.virError
	result := C.virDomainCreateWithFlagsWrapper(d.ptr, C.uint(flags), &err)
	if result == -1 {
		return makeError(&err)
	}
	return nil
}
20673
func (l *Localizer) LocalizeWithTag(lc *LocalizeConfig) (string, language.Tag, error) {
	messageID := lc.MessageID
	if lc.DefaultMessage != nil {
		if messageID != "" && messageID != lc.DefaultMessage.ID {
			return "", language.Und, &messageIDMismatchErr{messageID: messageID, defaultMessageID: lc.DefaultMessage.ID}
		}
		messageID = lc.DefaultMessage.ID
	}

	var operands *plural.Operands
	templateData := lc.TemplateData
	if lc.PluralCount != nil {
		var err error
		operands, err = plural.NewOperands(lc.PluralCount)
		if err != nil {
			return "", language.Und, &invalidPluralCountErr{messageID: messageID, pluralCount: lc.PluralCount, err: err}
		}
		if templateData == nil {
			templateData = map[string]interface{}{
				"PluralCount": lc.PluralCount,
			}
		}
	}
	tag, template := l.getTemplate(messageID, lc.DefaultMessage)
	if template == nil {
		return "", language.Und, &MessageNotFoundErr{messageID: messageID}
	}
	pluralForm := l.pluralForm(tag, operands)
	if pluralForm == plural.Invalid {
		return "", language.Und, &pluralizeErr{messageID: messageID, tag: tag}
	}
	msg, err := template.Execute(pluralForm, templateData, lc.Funcs)
	if err != nil {
		return "", language.Und, err
	}
	return msg, tag, nil
}
516548
func (c *Command) persistentFlag(name string) (flag *flag.Flag) {
	if c.HasPersistentFlags() {
		flag = c.PersistentFlags().Lookup(name)
	}

	if flag == nil {
		c.updateParentsPflags()
		flag = c.parentsPflags.Lookup(name)
	}
	return
}
51963
func LSetWithFlags(path, name string, data []byte, flags int) error {
	if err := lsetxattr(path, name, data, flags); err != nil {
		return &Error{"xattr.LSetWithFlags", path, name, err}
	}
	return nil
}
421329
func (vm *Engine) hasFlag(flag ScriptFlags) bool {
	return vm.flags&flag == flag
}
676107
func formatFlag(defaultValue, description string) cli.Flag {
	return newPlaceholder("format, f", "FORMAT", description,
		defaultValue, "TORUS_FORMAT", false)
}
371543
func (o *DeleteNodesIdentifierTagsTagnameParams) WithTagname(tagname string) *DeleteNodesIdentifierTagsTagnameParams {
	o.Tagname = tagname
	return o
}
97846
func ActiveFlags() (ret []Flag) {
	ret = make([]Flag, 0, 1)
	for f := range flags {
		if f.IsSet() {
			ret = append(ret, f)
		}
	}
	return
}
515960
func (c *Command) AddFlag(newFlag Flag) {
	c.Flags = append(c.Flags, newFlag)
}
1148668
func orgFlag(usage string, required bool) cli.Flag {
	return newPlaceholder("org, o", "ORG", usage, "", "TORUS_ORG", required)
}
716437
func (f *StringFlag) ApplyWithError(set *flag.FlagSet) error {
	f.set = set
	return f.StringFlag.ApplyWithError(set)
}
711528
func (f *ConfigFlags) WithDeprecatedPasswordFlag() *ConfigFlags {
	f.Username = stringptr("")
	f.Password = stringptr("")
	return f
}