// setDropFlag puts a flag into the drop channel if the channel is
// empty.  This is to signal that external log messages have been
// dropped.
436645
func (q *logQueue) setDropFlag() {
	select {
	case q.drop <- true:
		// do this outside the logging mechanism to make sure it gets through
		fmt.Fprintf(os.Stderr, "WARNING: dropping log messages destined for %q due to full log buffer\n", q.name)
	default:
	}
}
663637
func (c *listControllersCommand) SetFlags(f *gnuflag.FlagSet) {
	c.CommandBase.SetFlags(f)
	f.BoolVar(&c.refresh, "refresh", false, "Connect to each controller to download the latest details")
	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": c.formatControllersListTabular,
	})
}
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")
}
823888
func (c *updateCredentialCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ControllerCommandBase.SetFlags(f)
}
1016049
func (c *ListCommand) SetFlags(f *gnuflag.FlagSet) {
	c.SpaceCommandBase.SetFlags(f)
	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": c.printTabular,
	})
	f.BoolVar(&c.Short, "short", false, "only display spaces.")
}
677056
func (c *removeCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
	f.BoolVar(&c.Force, "force", false, "Completely remove a machine and all its dependencies")
	f.BoolVar(&c.KeepInstance, "keep-instance", false, "Do not stop the running cloud instance")
	f.BoolVar(&c.NoWait, "no-wait", false, "Rush through machine removal without waiting for each individual step to complete")
	c.fs = f
}
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.")
}
1232617
func (c *listFirewallRulesCommand) SetFlags(f *gnuflag.FlagSet) {
	c.out.AddFlags(f, "tabular", map[string]cmd.Formatter{
		"yaml":    cmd.FormatYaml,
		"json":    cmd.FormatJson,
		"tabular": formatListTabular,
	})
}
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)")
}
154922
func (obj TxValidationFlags) SetFlag(txIndex int, flag peer.TxValidationCode) {
	obj[txIndex] = uint8(flag)
}
1145384
func (c *CommandBase) SetFlags(f *gnuflag.FlagSet) {
	c.ModelCommandBase.SetFlags(f)
	if c.Log != nil {
		c.Log.AddFlags(f)
	}
}
589294
func (cmd *CLI) setFlagValue(flag *Flag, args []string) []string {
	if flag == nil {
		flag = noFlag // Fix for when we continue on error
	}
	splitArgs := []string{}
	hasSetValue := false
	hasPosValue := false
	isBoolFlag := false
	if fv, ok := flag.value.(boolFlag); ok && fv.IsBoolValue() {
		isBoolFlag = true
	}

	if len(args) > 0 {
		splitArgs = strings.Split(args[0], "=")
		hasSetValue = len(splitArgs) >= 2
		hasPosValue = len(args) >= 2 && args[1][0] != '-'
	}

	cutLen := 0

	var err error

	if hasSetValue {
		err = cmd.setFlag(flag, splitArgs[1])
		cutLen = 1
	} else if isBoolFlag {
		cmd.setFlag(flag, "true")
		cutLen = 1
	} else if hasPosValue {
		err = cmd.setFlag(flag, args[1])
		cutLen = 2
	} else {
		cmd.errf("flag \"--%v\" is missing a value", flag.Name)
	}

	cmd.handleErr(err)

	if len(args) > cutLen {
		return args[cutLen:]
	}
	return []string{}
}
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)
	}
}
1014248
func (c *removeCommand) SetFlags(f *gnuflag.FlagSet) {
	c.ControllerCommandBase.SetFlags(f)
	f.BoolVar(&c.force, "force", false, "remove the offer as well as any relations to the offer")
	f.BoolVar(&c.assumeYes, "y", false, "Do not prompt for confirmation")
	f.BoolVar(&c.assumeYes, "yes", false, "")
}
1244916
func (t *Module) AddFlag(flags ...cli.Flag) *Module {
	t.Flags = append(t.Flags, flags...)
	return t
}
1219779
func SetFlags(flags int) {
	defaultWriter.mutex.Lock()
	log.SetFlags(flags)
	defaultWriter.flags = flags
	defaultWriter.mutex.Unlock()
}
995309
func (c *addImageMetadataCommand) SetFlags(f *gnuflag.FlagSet) {
	c.cloudImageMetadataCommandBase.SetFlags(f)

	f.StringVar(&c.Region, "region", "", "image cloud region")
	f.StringVar(&c.Series, "series", "", "image series")
	f.StringVar(&c.Arch, "arch", "amd64", "image architecture")
	f.StringVar(&c.VirtType, "virt-type", "", "image metadata virtualisation type")
	f.StringVar(&c.RootStorageType, "storage-type", "", "image metadata root storage type")
	f.Uint64Var(&c.RootStorageSize, "storage-size", 0, "image metadata root storage size")
	f.StringVar(&c.Stream, "stream", "released", "image metadata stream")
}