// CheckRequiredFlags ensures that any required flags have been set either on
// the command line, or through envvars/prefs files.
779856
func checkRequiredFlags(ctx *cli.Context) error {
	missing := []string{}
	for _, f := range ctx.Command.Flags {
		var name string
		flagMissing := false
		switch pf := f.(type) {
		case placeHolderStringFlag:
			name = strings.SplitN(pf.GetName(), ",", 2)[0]
			if pf.Required && ctx.String(name) == "" {
				flagMissing = true
			}
		case placeHolderStringSliceFlag:
			name = strings.SplitN(pf.GetName(), ",", 2)[0]
			if pf.Required && len(ctx.StringSlice(name)) == 0 {
				flagMissing = true
			}

		}
		if flagMissing {
			prefix := "-"
			if len(name) > 1 {
				prefix = "--"
			}
			missing = append(missing, prefix+name)
		}

	}

	if len(missing) > 0 {
		msg := "Missing flags: " + strings.Join(missing, ", ")
		return errs.NewUsageExitError(msg, ctx)
	}

	return nil
}
1178885
func (o *ReplicaSetControllerOptions) AddFlags(fs *pflag.FlagSet) {
	if o == nil {
		return
	}

	fs.Int32Var(&o.ConcurrentRSSyncs, "concurrent-replicaset-syncs", o.ConcurrentRSSyncs, "The number of replica sets that are allowed to sync concurrently. Larger number = more responsive replica management, but more CPU (and network) load")
}
912809
func (c *RFCCommand) VisitAllFlags(fn func(*flag.Flag)) {
	c.flags.VisitAll(fn)
}
73887
func AddTrustVerificationFlags(fs *pflag.FlagSet, v *bool, trusted bool) {
	fs.BoolVar(v, "disable-content-trust", !trusted, "Skip image verification")
}
802846
func getFlags(flagSet *gnuflag.FlagSet, flagNames []string) []string {
	flags := make([]string, 0, flagSet.NFlag())
	flagSet.Visit(func(flag *gnuflag.Flag) {
		for _, name := range flagNames {
			if flag.Name == name {
				flags = append(flags, flagWithMinus(name))
			}
		}
	})
	return flags
}
821601
func (plugin *kubenetNetworkPlugin) checkRequiredCNIPlugins() bool {
	for _, dir := range plugin.binDirs {
		if plugin.checkRequiredCNIPluginsInOneDir(dir) {
			return true
		}
	}
	return false
}
953498
func GetFlags(config interface{}) ([]string, error) {
	flagMap := make(map[string]reflect.StructField)
	if err := getTypesRecursive(reflect.ValueOf(config), flagMap, ""); err != nil {
		return []string{}, err
	}

	flags := make([]string, 0, len(flagMap))
	for f := range flagMap {
		flags = append(flags, f)
	}
	return flags, nil
}
445027
func InitFlags() {
	pflag.CommandLine.SetNormalizeFunc(WordSepNormalizeFunc)
	pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
	pflag.Parse()
}
922401
func flagsToCompleteFlags(flags []cli.Flag) complete.Flags {
	var complFlags = make(complete.Flags)
	for _, f := range flags {
		for _, s := range strings.Split(f.GetName(), ",") {
			var flagName string
			s = strings.TrimSpace(s)
			if len(s) == 1 {
				flagName = "-" + s
			} else {
				flagName = "--" + s
			}
			complFlags[flagName] = complete.PredictNothing
		}
	}
	return complFlags
}
345114
func CheckRequiredKeys(cb config.Backend) error {
	if err := config.CheckConfig("/deis/platform/", "domain", cb); err != nil {
		return fmt.Errorf(`Missing platform domain, use:
deisctl config platform set domain=<your-domain>`)
	}

	if err := config.CheckConfig("/deis/platform/", "sshPrivateKey", cb); err != nil {
		fmt.Printf(`Warning: Missing sshPrivateKey, "deis run" will be unavailable. Use:
deisctl config platform set sshPrivateKey=<path-to-key>
`)
	}
	return nil
}
928877
func (cmd *ShowAccountCommand) RegisterFlags(cc *cobra.Command, c *client.Client) {
	var accountID int
	cc.Flags().IntVar(&cmd.AccountID, "accountID", accountID, `Account ID`)
}
495581
func validateRequired(v interface{}, name string) error {
	if v == nil {
		return ErrRequired
	}
	return validateNonEmpty(v, name)
}
1085592
func (o *TTLAfterFinishedControllerOptions) AddFlags(fs *pflag.FlagSet) {
	if o == nil {
		return
	}

	fs.Int32Var(&o.ConcurrentTTLSyncs, "concurrent-ttl-after-finished-syncs", o.ConcurrentTTLSyncs, "The number of TTL-after-finished controller workers that are allowed to sync concurrently.")
}
918298
func (c *Command) Flags() *flag.FlagSet {
	if c.flags == nil {
		c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
		if c.flagErrorBuf == nil {
			c.flagErrorBuf = new(bytes.Buffer)
		}
		c.flags.SetOutput(c.flagErrorBuf)
	}

	return c.flags
}
1122590
func (o *ObjectConstraint) IsPropRequired(s string) bool {
	o.reqlock.Lock()
	defer o.reqlock.Unlock()

	_, ok := o.required[s]
	return ok
}
708277
func (c *trustCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
	f.BoolVar(&c.removeTrust, "remove", false, "Remove trusted access from a trusted application")
}
685488
func (cmd *CLI) SubCommandsInheritFlags(names ...string) {
	for _, name := range names {
		cmd.SubCommandsInheritFlag(name)
	}
}