// SetFlags implements part of the cmd.Command interface.
507167
func (c *trackBranchCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
}
434262
func (c *modelsCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ControllerCommandBase.SetFlags(f)
	f.StringVar(&c.user, "user", "", "The user to list models for (administrative users only)")
	f.BoolVar(&c.all, "all", false, "Lists all models, regardless of user accessibility (administrative users only)")
	f.BoolVar(&c.listUUID, "uuid", false, "Display UUID for models")
	f.BoolVar(&c.exactTime, "exact-time", false, "Use full timestamps")
	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": c.formatTabular,
	})
}
36175
func (l *Logger) SetFlags(flag int) {
	l.Logger.SetFlags(flag)

	// Only proceed if we've actually got a prefix
	if l.Prefix() == "" {
		return
	}

	const clnSpc = ": "
	if flag&(log.Lshortfile|log.Llongfile) != 0 {
		l.SetPrefix(strings.TrimSuffix(l.Prefix(), clnSpc))
	} else {
		l.SetPrefix(l.Prefix() + clnSpc)
	}
}
12490
func (c *listAgreementsCommand) SetFlags(f *gnuflag.FlagSet) {
	c.CommandBase.SetFlags(f)
	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"tabular": formatTabular,
		"json":    formatJSON,
		"yaml":    cmd.FormatYaml,
	})
}
121386
func (cmd *CLI) setFlag(flag *Flag, value string) error {
	_ = cmd.flags[flag.Name] // Verify the flag is a flag for f set
	err := flag.value.Set(value)
	if err != nil {
		return err
	}
	cmd.flagValues[flag] = flag.value
	return nil
}
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)
		}
	}
}
1200161
func (c *detachStorageCommand) SetFlags(f *gnuflag.FlagSet) {
	c.StorageCommandBase.SetFlags(f)
	f.BoolVar(&c.Force, "force", false, "Forcefully detach storage")
	c.fs = f
}
486207
func (c *setFirewallRuleCommand) SetFlags(f *gnuflag.FlagSet) {
	f.StringVar(&c.whitelistValue, "whitelist", "", "list of subnets to whitelist")
}
1368586
func (l *Logger) SetFlags(flags FlagSet) {
	atomic.StoreUint64(&l.flags, uint64(flags))
}
1330819
func (c *dumpCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
	f.BoolVar(&c.simplified, "simplified", false, "Dump a simplified partial model")
}
476957
func (c *dumpLogsCommand) SetFlags(f *gnuflag.FlagSet) {
	c.agentConfig.AddFlags(f)
	f.StringVar(&c.outDir, "d", ".", "directory to write logs files to")
	f.StringVar(&c.outDir, "output-directory", ".", "")
	f.StringVar(&c.machineId, "machine-id", "", "id of the machine on this host (optional)")
}
816273
func (c *cancelCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ActionCommandBase.SetFlags(f)
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
}
897319
func (c *showCommand) SetFlags(f *gnuflag.FlagSet) {
	c.RemoteEndpointsCommandBase.SetFlags(f)
	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": formatShowTabular,
	})
}
1281952
func (c *checkoutCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
}
1237878
func (cmd *CLI) setFlagDefaults() {
	for _, flag := range cmd.flags {
		cmd.setFlag(flag, flag.DefValue)
	}
}
382576
func (c *listCommand) SetFlags(f *gnuflag.FlagSet) {
	c.CachedImagesCommandBase.SetFlags(f)
	f.StringVar(&c.Kind, "kind", "", "The image kind to list eg lxd")
	f.StringVar(&c.Series, "series", "", "The series of the image to list eg xenial")
	f.StringVar(&c.Arch, "arch", "", "The architecture of the image to list eg amd64")
	c.out.AddFlags(f, "yaml", output.DefaultFormatters)
}
197174
func (c *configCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)

	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"json":    cmd.FormatJson,
		"tabular": formatConfigTabular,
		"yaml":    cmd.FormatYaml,
	})
	f.Var(cmd.NewAppendStringsValue(&c.reset), "reset", "Reset the provided comma delimited keys")
}