// FormatFlagsOp returns the StoreItem that executes the flags operation op.
763912
func FormatFlagsOp(op FlagsOp, silent bool) StoreItem {
	s := string(op)
	if silent {
		s += silentOp
	}
	return StoreItem(s)
}
1073874
func (s *scene) StoreAndFlag(key string, prop interface{}) error {
	err := s.StoreClean(key, prop, nil)
	if err != nil {
		return err
	}
	return s.Flag(key)
}
1048575
func (c *slaCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"tabular": formatTabular,
		"json":    cmd.FormatJson,
		"yaml":    cmd.FormatYaml,
	})
	f.StringVar(&c.Budget, "budget", "", "the maximum spend for the model")
}
138846
func validFlags(flags net.Flags) error {
	if (flags & syscall.IFF_UP) != syscall.IFF_UP {
		return fmt.Errorf("Unsupported network flags specified: %v", flags)
	}

	return nil
}
340849
func WithFlag(flag ...cli.Flag) Option {
	return func(o *Options) {
		o.Flags = append(o.Flags, flag...)
	}
}
38191
func (c *Command) PersistentFlags() *flag.FlagSet {
	if c.pflags == nil {
		c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
		if c.flagErrorBuf == nil {
			c.flagErrorBuf = new(bytes.Buffer)
		}
		c.pflags.SetOutput(c.flagErrorBuf)
	}
	return c.pflags
}
147790
func (o *DeploymentControllerOptions) AddFlags(fs *pflag.FlagSet) {
	if o == nil {
		return
	}

	fs.Int32Var(&o.ConcurrentDeploymentSyncs, "concurrent-deployment-syncs", o.ConcurrentDeploymentSyncs, "The number of deployment objects that are allowed to sync concurrently. Larger number = more responsive deployments, but more CPU (and network) load")
	fs.DurationVar(&o.DeploymentControllerSyncPeriod.Duration, "deployment-controller-sync-period", o.DeploymentControllerSyncPeriod.Duration, "Period for syncing the deployments.")
}
927966
func NewMapPolicyWithFlags(order mapOrderType, flags int) *MapPolicy {
	return &MapPolicy{
		attributes:   order,
		flags:        flags,
		itemCommand:  MapWriteMode.UPDATE.itemCommand,
		itemsCommand: MapWriteMode.UPDATE.itemsCommand,
	}
}
551494
func (c *findCommand) SetFlags(f *gnuflag.FlagSet) {
	c.RemoteEndpointsCommandBase.SetFlags(f)
	f.StringVar(&c.url, "url", "", "return results matching the offer URL")
	f.StringVar(&c.interfaceName, "interface", "", "return results matching the interface name")
	f.StringVar(&c.offerName, "offer", "", "return results matching the offer name")
	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": formatFindTabular,
	})
}
974222
func (c *listCommand) SetFlags(f *gnuflag.FlagSet) {
	c.CommandBase.SetFlags(f)
}
1002405
func (cmd *createSnapshotCmd) validateFlags(c context.Context) (map[string]string, error) {
	if cmd.disk == "" {
		return nil, errors.New("-disk is required")
	}
	labels := make(map[string]string, len(cmd.labels))
	for _, label := range cmd.labels {
		parts := strings.SplitN(label, ":", 2)
		if len(parts) != 2 {
			return nil, errors.New(fmt.Sprintf("-label %q must be in key:value form", label))
		}
		if _, ok := labels[parts[0]]; ok {
			return nil, errors.New(fmt.Sprintf("-label %q has duplicate key", label))
		}
		labels[parts[0]] = parts[1]
	}
	if cmd.name == "" {
		return nil, errors.New("-name is required")
	}
	if cmd.project == "" {
		return nil, errors.New("-project is required")
	}
	if cmd.zone == "" {
		return nil, errors.New("-zone is required")
	}
	return labels, nil
}
946267
func (o TaintOptions) validateFlags() error {
	// Cannot have a non-empty selector and all flag set. They are mutually exclusive.
	if o.all && o.selector != "" {
		return fmt.Errorf("setting 'all' parameter with a non empty selector is prohibited.")
	}
	// If both selector and all are not set.
	if !o.all && o.selector == "" {
		if len(o.resources) < 2 {
			return fmt.Errorf("at least one resource name must be specified since 'all' parameter is not set")
		} else {
			return nil
		}
	}
	return nil
}
1340338
func (c *configCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ControllerCommandBase.SetFlags(f)
	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"json":    cmd.FormatJson,
		"tabular": formatConfigTabular,
		"yaml":    cmd.FormatYaml,
	})
}
688093
func PrintFlags(flags interface{}) {
	t := reflect.TypeOf(flags).Elem()
	if t.NumField() > 0 {
		maxArg := 0
		maxLong := 0
		maxShort := 0
		for i := 0; i < t.NumField(); i++ {
			if t.Field(i).Tag.Get("arg") != "" {
				maxArg = 4
			}
			if long := len(t.Field(i).Tag.Get("long")); long > maxLong {
				maxLong = long
			}
			if short := len(t.Field(i).Tag.Get("short")); short > maxShort {
				maxShort = short
			}
		}
		//formatLong := "    -%" + strconv.Itoa(maxShort) + "s, %" + strconv.Itoa(maxLong) + "s%" + strconv.Itoa(maxArg) + "s : %s\n"
		//formatShort := "     %" + strconv.Itoa(maxShort+maxLong+4) + "s %" + strconv.Itoa(maxArg) + "s : %s\n"
		for i := 0; i < t.NumField(); i++ {
			short := t.Field(i).Tag.Get("short")
			long := t.Field(i).Tag.Get("long")
			arg := t.Field(i).Tag.Get("arg")
			desc := t.Field(i).Tag.Get("desc")
			format := " : %s\n"
			if maxArg > 0 {
				if arg == "true" {
					format = " arg" + format
				} else {
					format = "    " + format
				}
			}
			if long != "" {
				format = "    %" + strconv.Itoa(maxShort+1) + "s, %" + strconv.Itoa(maxLong+2) + "s" + format
				fmt.Printf(format, "-"+short, "--"+long, desc)
			} else {
				format = "    %" + strconv.Itoa(maxShort+maxLong+5) + "s" + format
				fmt.Printf(format, "-"+short, desc)
			}
		}
		print("\n\n")
	}
}
1074628
func (l *Logger) WithFlags(flags int, f func(...interface{}), args ...interface{}) {
	cFlags := l.flags
	l.SetFlags(flags)
	f(args...)
	l.SetFlags(cFlags)
}
352989
func (c *Config) AddFlagsPrefix(fs *flag.FlagSet, prefix string) {
	fs.Var(&c.Level, prefix+"log-level",
		"The logging level. Valid options are: debug, info, warning, error.")
}
453437
func (f *formatState) buildDefaultFormat() (format string) {
	buf := bytes.NewBuffer(percentBytes)

	for _, flag := range supportedFlags {
		if f.fs.Flag(int(flag)) {
			buf.WriteRune(flag)
		}
	}

	buf.WriteRune('v')

	format = buf.String()
	return format
}