// SetFlags implements cmd.Command.
486207
func (c *setFirewallRuleCommand) SetFlags(f *gnuflag.FlagSet) {
	f.StringVar(&c.whitelistValue, "whitelist", "", "list of subnets to whitelist")
}
201096
func (c *unregisterCommand) SetFlags(f *gnuflag.FlagSet) {
	f.BoolVar(&c.assumeYes, "y", false, "Do not prompt for confirmation")
	f.BoolVar(&c.assumeYes, "yes", false, "")
}
1045420
func (c *OptionalControllerCommand) SetFlags(f *gnuflag.FlagSet) {
	c.CommandBase.SetFlags(f)
	f.BoolVar(&c.Local, "local", false, "Local operation only; controller not affected")
	f.StringVar(&c.controllerName, "c", "", "Controller to operate in")
	f.StringVar(&c.controllerName, "controller", "", "")
}
403214
func (c *upgradeGUICommand) SetFlags(f *gnuflag.FlagSet) {
	c.ControllerCommandBase.SetFlags(f)
	f.BoolVar(&c.list, "list", false, "List available Juju GUI release versions without upgrading")
}
112169
func (c *statusCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ActionCommandBase.SetFlags(f)
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
	f.StringVar(&c.name, "name", "", "Action name")
}
1348746
func (c *offerCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ControllerCommandBase.SetFlags(f)
}
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)
}
517648
func (p *ListCmd) SetFlags(f *flag.FlagSet) {
	f.BoolVar(&p.debug, "debug", false, "debug mode")
	f.BoolVar(&p.debugSQL, "debug-sql", false, "SQL debug mode")

	defaultLogDir := util.GetDefaultLogDir()
	f.StringVar(&p.logDir, "log-dir", defaultLogDir, "/path/to/log")
	f.BoolVar(&p.logJSON, "log-json", false, "output log as JSON")

	pwd := os.Getenv("PWD")
	f.StringVar(&p.dbpath, "dbpath", pwd+"/cve.sqlite3",
		"/path/to/sqlite3 or SQL connection string")

	f.StringVar(&p.dbtype, "dbtype", "sqlite3",
		"Database type to store data in (sqlite3, mysql, postgres or redis supported)")

	f.StringVar(
		&p.httpProxy,
		"http-proxy",
		"",
		"http://proxy-url:port (default: empty)",
	)
}
444925
func (p *Parser) SetFlags(flags interface{}) {
	flagsElement := reflect.ValueOf(flags).Elem()
	flagsType := flagsElement.Type()
	for i := 0; i < flagsElement.NumField(); i++ {
		typeField := flagsType.Field(i)
		elementField := flagsElement.Field(i)
		var deletion string
		for k, v := range p.flags {
			if k == typeField.Tag.Get(v.kind) && elementField.CanSet() {
				var err error
				switch elementField.Kind() {
				case reflect.Bool:
					elementField.SetBool(true)
				case reflect.String:
					elementField.SetString(v.value)
				case reflect.Int64:
					i, e := strconv.ParseInt(v.value, 10, 64)
					if e == nil {
						elementField.SetInt(i)
					} else {
						err = e
					}
				case reflect.Uint64:
					u, e := strconv.ParseUint(v.value, 10, 64)
					if e == nil {
						elementField.SetUint(u)
					} else {
						err = e
					}
				case reflect.Float64:
					f, e := strconv.ParseFloat(v.value, 64)
					if e == nil {
						elementField.SetFloat(f)
					} else {
						err = e
					}
				default:
					panic("[cli-ng] Unsupported flag type: " + elementField.Kind().String())
				}
				if err != nil {
					panic("Failed to parse flag '" + k + "', reason: " + err.Error())
				}
				deletion = k
				break
			}
		}
		if deletion != "" {
			delete(p.flags, deletion)
		}
	}
}
723807
func (c *listImagesCommand) SetFlags(f *gnuflag.FlagSet) {
	c.cloudImageMetadataCommandBase.SetFlags(f)

	f.StringVar(&c.Stream, "stream", "", "image metadata stream")
	f.StringVar(&c.Region, "region", "", "image metadata cloud region")

	f.Var(cmd.NewAppendStringsValue(&c.Series), "series", "only show cloud image metadata for these series")
	f.Var(cmd.NewAppendStringsValue(&c.Arches), "arch", "only show cloud image metadata for these architectures")

	f.StringVar(&c.VirtType, "virt-type", "", "image metadata virtualisation type")
	f.StringVar(&c.RootStorageType, "storage-type", "", "image metadata root storage type")

	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": formatMetadataListTabular,
	})
}
409184
func (c *removeCommand) SetFlags(f *gnuflag.FlagSet) {
	c.CommandBase.SetFlags(f)
	f.BoolVar(&c.KeepLatest, "keep-latest", false,
		"Remove all backups on remote storage except for the latest.")
}
715083
func (c *listCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ActionCommandBase.SetFlags(f)

	// `listCommand's` default format depends on the value of another flag.
	// That is, if no default is selected using the `--format` flag, then
	// the output format depends on whether or not the user has specified
	// the `--schema` flag (schema output does not support tabular which is
	// the default for all other output from this command). Currently the
	// `cmd` package's `Output` structure has no methods that support
	// selecting a default format dynamically. Here we introduce a "default"
	// default which serves to indicate that the user wants default
	// formatting behavior. This allows us to select the appropriate default
	// behavior in the presence of the "default" format value.
	c.out.AddFlags(f, "default", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": c.printTabular,
		"default": c.dummyDefault,
	})
	f.BoolVar(&c.fullSchema, "schema", false, "Display the full action schema")
}
1368586
func (l *Logger) SetFlags(flags FlagSet) {
	atomic.StoreUint64(&l.flags, uint64(flags))
}
1239638
func (c *ListPlansCommand) SetFlags(f *gnuflag.FlagSet) {
	c.CommandBase.SetFlags(f)
	defaultFormat := "tabular"
	c.out.AddFlags(f, defaultFormat, map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"smart":   cmd.FormatSmart,
		"summary": formatSummary,
		"tabular": formatTabular,
	})
}
9453
func (c *defaultsCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ControllerCommandBase.SetFlags(f)

	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": formatDefaultConfigTabular,
	})
	f.Var(cmd.NewAppendStringsValue(&c.reset), "reset", "Reset the provided comma delimited keys")
}
1082907
func (c *runCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ActionCommandBase.SetFlags(f)
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
	f.Var(&c.paramsYAML, "params", "Path to yaml-formatted params file")
	f.BoolVar(&c.parseStrings, "string-args", false, "Use raw string values of CLI args")
	f.Var(&c.wait, "wait", "Wait for results, with optional timeout")
}
810752
func (c *showCommand) SetFlags(f *gnuflag.FlagSet) {
	c.StorageCommandBase.SetFlags(f)
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
}