// DefineFlagsFor registers defined flags for plugin with given name.
338768
func DefineFlagsFor(name string) {
	if plugSet, ok := pluginFlags[name]; ok {
		plugSet.VisitAll(func(f *flag.Flag) {
			flag.CommandLine.Var(f.Value, f.Name, f.Usage)
		})
	}
}
35019
func (p *Profiler) AddFlags(fs *flag.FlagSet) {
	fs.StringVar(&p.BindHTTP, "profile-bind-http", "",
		"If specified, run a runtime profiler HTTP server bound to this [address][:port].")
	fs.StringVar(&p.Dir, "profile-output-dir", "",
		"If specified, allow generation of profiling artifacts, which will be written here.")
	fs.BoolVar(&p.ProfileCPU, "profile-cpu", false, "If specified, enables CPU profiling.")
	fs.BoolVar(&p.ProfileHeap, "profile-heap", false, "If specified, enables heap profiling.")

}
1063900
func (r *RegisterMeteredCharm) SetFlags(f *gnuflag.FlagSet) {
	f.IntVar(&r.IncreaseBudget, "increase-budget", 0, "increase model budget allocation by this amount")
	f.StringVar(&r.Plan, "plan", "", "plan to deploy charm under")
}
974222
func (c *listCommand) SetFlags(f *gnuflag.FlagSet) {
	c.CommandBase.SetFlags(f)
}
1290963
func (cmd *CLI) DefineIntFlag(name string, value int, usage string) *int {
	p := new(int)
	cmd.DefineIntFlagVar(p, name, value, usage)
	return p
}
1044216
func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) {
	pflag.CommandLine.StringSliceVar(&ca.BasePeerDirs, "base-peer-dirs", ca.BasePeerDirs,
		"Comma-separated list of apimachinery import paths which are considered, after tag-specified peers, for conversions. Only change these if you have very good reasons.")
	pflag.CommandLine.StringSliceVar(&ca.ExtraPeerDirs, "extra-peer-dirs", ca.ExtraPeerDirs,
		"Application specific comma-separated list of import paths which are considered, after tag-specified peers and base-peer-dirs, for conversions.")
	pflag.CommandLine.BoolVar(&ca.SkipUnsafe, "skip-unsafe", ca.SkipUnsafe,
		"If true, will not generate code using unsafe pointer conversions; resulting code may be slower.")
}
348067
func (cl *CoLog) SetFlags(flags int) {
	cl.mu.Lock()
	defer cl.mu.Unlock()
	if cl.formatter == nil {
		return
	}

	cl.formatter.SetFlags(flags)
}
191772
func MaskFromFlags(flags ...Flag) Mask {
	var mask Mask
	for _, flag := range flags {
		mask |= Mask(flag)
	}

	return mask
}
1296322
func (c *commitCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
}
1211185
func RegisterFlags() {
	fmt.Println("Registering flags...")
	flag.StringVar(&testFlagString, "ep-string", "my-value",
		"Example of a string flag.")
	flag.IntVar(&testFlagInt, "ep-int", 1122,
		"Example of an int flag.")
	flag.Int64Var(&testFlagInt64, "ep-int64", -3344,
		"Example of an int64 flag.")
	flag.UintVar(&testFlagUint, "ep-uint", 5566,
		"Example of a uint flag.")
	flag.Uint64Var(&testFlagUint64, "ep-uint64", 7788,
		"Example of a uint64 flag.")
	flag.BoolVar(&testFlagBool, "ep-bool", true,
		"Example of a bool flag.")
	flag.DurationVar(&testFlagDur, "ep-duration", time.Second*5,
		"Example of a duration flag.")
}
323634
func (op *CaasOperatorAgent) SetFlags(f *gnuflag.FlagSet) {
	op.AgentConf.AddFlags(f)
	f.StringVar(&op.ApplicationName, "application-name", "", "name of the application")
}
1138470
func RegisterFlags(userKeys ...string) {
	registerBaseFlags()
	for _, userKey := range userKeys {
		uc := &userConfig{}
		dbConfigs.userConfigs[userKey] = uc
		registerPerUserFlags(uc, userKey)
	}
}
55989
func AddFlags(fs *flag.FlagSet, f *Flags) {
	add := func(p interface{}, name, help string) {
		switch x := p.(type) {
		case **bool:
			fs.Var(newBoolPtrValue(x), name, help)
		case **time.Duration:
			fs.Var(newDurationPtrValue(x), name, help)
		case **int:
			fs.Var(newIntPtrValue(x), name, help)
		case **string:
			fs.Var(newStringPtrValue(x), name, help)
		case *[]string:
			fs.Var(newStringSliceValue(x), name, help)
		case *map[string]string:
			fs.Var(newStringMapValue(x), name, help)
		default:
			panic(fmt.Sprintf("invalid type: %T", p))
		}
	}

	// command line flags ordered by flag name
	add(&f.Config.AdvertiseAddrLAN, "advertise", "Sets the advertise address to use.")
	add(&f.Config.AdvertiseAddrWAN, "advertise-wan", "Sets address to advertise on WAN instead of -advertise address.")
	add(&f.Config.BindAddr, "bind", "Sets the bind address for cluster communication.")
	add(&f.Config.Ports.Server, "server-port", "Sets the server port to listen on.")
	add(&f.Config.Bootstrap, "bootstrap", "Sets server to bootstrap mode.")
	add(&f.Config.BootstrapExpect, "bootstrap-expect", "Sets server to expect bootstrap mode.")
	add(&f.Config.ClientAddr, "client", "Sets the address to bind for client access. This includes RPC, DNS, HTTP, HTTPS and gRPC (if configured).")
	add(&f.ConfigFiles, "config-dir", "Path to a directory to read configuration files from. This will read every file ending in '.json' as configuration in this directory in alphabetical order. Can be specified multiple times.")
	add(&f.ConfigFiles, "config-file", "Path to a file in JSON or HCL format with a matching file extension. Can be specified multiple times.")
	add(&f.ConfigFormat, "config-format", "Config files are in this format irrespective of their extension. Must be 'hcl' or 'json'")
	add(&f.Config.DataDir, "data-dir", "Path to a data directory to store agent state.")
	add(&f.Config.Datacenter, "datacenter", "Datacenter of the agent.")
	add(&f.DevMode, "dev", "Starts the agent in development mode.")
	add(&f.Config.DisableHostNodeID, "disable-host-node-id", "Setting this to true will prevent Consul from using information from the host to generate a node ID, and will cause Consul to generate a random node ID instead.")
	add(&f.Config.DisableKeyringFile, "disable-keyring-file", "Disables the backing up of the keyring to a file.")
	add(&f.Config.Ports.DNS, "dns-port", "DNS port to use.")
	add(&f.Config.DNSDomain, "domain", "Domain to use for DNS interface.")
	add(&f.Config.EnableScriptChecks, "enable-script-checks", "Enables health check scripts.")
	add(&f.Config.EnableLocalScriptChecks, "enable-local-script-checks", "Enables health check scripts from configuration file.")
	add(&f.Config.HTTPConfig.AllowWriteHTTPFrom, "allow-write-http-from", "Only allow write endpoint calls from given network. CIDR format, can be specified multiple times.")
	add(&f.Config.EncryptKey, "encrypt", "Provides the gossip encryption key.")
	add(&f.Config.Ports.GRPC, "grpc-port", "Sets the gRPC API port to listen on (currently needed for Envoy xDS only).")
	add(&f.Config.Ports.HTTP, "http-port", "Sets the HTTP API port to listen on.")
	add(&f.Config.StartJoinAddrsLAN, "join", "Address of an agent to join at start time. Can be specified multiple times.")
	add(&f.Config.StartJoinAddrsWAN, "join-wan", "Address of an agent to join -wan at start time. Can be specified multiple times.")
	add(&f.Config.LogLevel, "log-level", "Log level of the agent.")
	add(&f.Config.LogFile, "log-file", "Path to the file the logs get written to")
	add(&f.Config.LogRotateBytes, "log-rotate-bytes", "Maximum number of bytes that should be written to a log file")
	add(&f.Config.LogRotateDuration, "log-rotate-duration", "Time after which log rotation needs to be performed")
	add(&f.Config.NodeName, "node", "Name of this node. Must be unique in the cluster.")
	add(&f.Config.NodeID, "node-id", "A unique ID for this node across space and time. Defaults to a randomly-generated ID that persists in the data-dir.")
	add(&f.Config.NodeMeta, "node-meta", "An arbitrary metadata key/value pair for this node, of the format `key:value`. Can be specified multiple times.")
	add(&f.Config.NonVotingServer, "non-voting-server", "(Enterprise-only) This flag is used to make the server not participate in the Raft quorum, and have it only receive the data replication stream. This can be used to add read scalability to a cluster in cases where a high volume of reads to servers are needed.")
	add(&f.Config.PidFile, "pid-file", "Path to file to store agent PID.")
	add(&f.Config.RPCProtocol, "protocol", "Sets the protocol version. Defaults to latest.")
	add(&f.Config.RaftProtocol, "raft-protocol", "Sets the Raft protocol version. Defaults to latest.")
	add(&f.Config.DNSRecursors, "recursor", "Address of an upstream DNS server. Can be specified multiple times.")
	add(&f.Config.RejoinAfterLeave, "rejoin", "Ignores a previous leave and attempts to rejoin the cluster.")
	add(&f.Config.RetryJoinIntervalLAN, "retry-interval", "Time to wait between join attempts.")
	add(&f.Config.RetryJoinIntervalWAN, "retry-interval-wan", "Time to wait between join -wan attempts.")
	add(&f.Config.RetryJoinLAN, "retry-join", "Address of an agent to join at start time with retries enabled. Can be specified multiple times.")
	add(&f.Config.RetryJoinWAN, "retry-join-wan", "Address of an agent to join -wan at start time with retries enabled. Can be specified multiple times.")
	add(&f.Config.RetryJoinMaxAttemptsLAN, "retry-max", "Maximum number of join attempts. Defaults to 0, which will retry indefinitely.")
	add(&f.Config.RetryJoinMaxAttemptsWAN, "retry-max-wan", "Maximum number of join -wan attempts. Defaults to 0, which will retry indefinitely.")
	add(&f.Config.SerfBindAddrLAN, "serf-lan-bind", "Address to bind Serf LAN listeners to.")
	add(&f.Config.Ports.SerfLAN, "serf-lan-port", "Sets the Serf LAN port to listen on.")
	add(&f.Config.SegmentName, "segment", "(Enterprise-only) Sets the network segment to join.")
	add(&f.Config.SerfBindAddrWAN, "serf-wan-bind", "Address to bind Serf WAN listeners to.")
	add(&f.Config.Ports.SerfWAN, "serf-wan-port", "Sets the Serf WAN port to listen on.")
	add(&f.Config.ServerMode, "server", "Switches agent to server mode.")
	add(&f.Config.EnableSyslog, "syslog", "Enables logging to syslog.")
	add(&f.Config.UI, "ui", "Enables the built-in static web UI server.")
	add(&f.Config.UIDir, "ui-dir", "Path to directory containing the web UI resources.")
	add(&f.HCL, "hcl", "hcl config fragment. Can be specified multiple times.")
}
309677
func (cmd *CLI) DefineUint64FlagVar(p *uint64, name string, value uint64, usage string) {
	cmd.DefineFlag(values.NewUint64(value, p), name, usage)
}
1314430
func (w *controllerCommandWrapper) SetFlags(f *gnuflag.FlagSet) {
	if w.setControllerFlags {
		f.StringVar(&w.controllerName, "c", "", "Controller to operate in")
		f.StringVar(&w.controllerName, "controller", "", "")
	}
	w.ControllerCommand.SetFlags(f)
}
468451
func (c *ListCommand) SetFlags(f *gnuflag.FlagSet) {
	c.SubnetCommandBase.SetFlags(f)
	c.Out.AddFlags(f, "yaml", output.DefaultFormatters)

	f.StringVar(&c.SpaceName, "space", "", "Filter results by space name")
	f.StringVar(&c.ZoneName, "zone", "", "Filter results by zone name")
}
624477
func ValidateFlags(fs *flag.FlagSet) MultiFlagError {
	if fs == nil {
		fs = flag.CommandLine
	}
	var flagErrors []*FlagError
	checkGetError := func(f *flag.Flag) {
		if fv, ok := f.Value.(flag.Getter); ok {
			if err, ok := fv.Get().(error); ok && err != nil {
				flagErrors = append(flagErrors, &FlagError{f, err})
			}
		}
	}
	fs.VisitAll(checkGetError)
	if len(flagErrors) > 0 {
		return MultiFlagError(flagErrors)
	}
	return nil
}