// hasFlag returns whether the script engine instance has the passed flag set.
421329
func (vm *Engine) hasFlag(flag ScriptFlags) bool {
	return vm.flags&flag == flag
}
248961
func HandleFlags(f *Flags) bool {
	if !f.HasMatch() {
		return false
	}

	if f.ShowHelp() {
		f.PrintHelp()
	}

	if f.ShowVersion() {
		f.PrintVersion()
	}

	return true
}
1124445
func (f *FlagSet) Has(p FlagSet) bool {
	if *f&p != 0 {
		return true
	}
	return false
}
710361
func (ctx *Context) IsSet(flag string, aliasFlags ...string) bool {
	fl, ok := ctx.flagSet.flagMap[flag]
	if ok {
		return fl.isSet
	}
	for _, alias := range aliasFlags {
		if fl, ok := ctx.flagSet.flagMap[alias]; ok {
			return fl.isSet
		}
	}
	return false
}
933012
func (c *Command) Flag(name string) (flag *flag.Flag) {
	flag = c.Flags().Lookup(name)

	if flag == nil {
		flag = c.persistentFlag(name)
	}

	return
}
1161113
func (s *Style) Has(ttype TokenType) bool {
	return !s.get(ttype).IsZero() || s.synthesisable(ttype)
}
859173
func (s *SessionVars) SetStatusFlag(flag uint16, on bool) {
	if on {
		s.Status |= flag
		return
	}
	s.Status &= (^flag)
}
1310652
func checkFlags(flags map[string]bool, args []string, print func(string)) int {
	num := 0 // Number of valid flags, use to cut out.
	for i, f := range args {
		// Check flag prefix '-'.
		if !strings.HasPrefix(f, "-") {
			// Not a flag, finish check process.
			break
		}

		// Check if it a valid flag.
		if v, ok := flags[f]; ok {
			flags[f] = !v
			if !v {
				print(f)
			} else {
				fmt.Println("DISABLE: " + f)
			}
		} else {
			fmt.Printf("[ERRO] Unknown flag: %s.\n", f)
			return -1
		}
		num = i + 1
	}

	return num
}
799938
func (bf *BFlags) addFlag(name string, flagType FlagType) *Flag {
	if _, ok := bf.flags[name]; ok {
		bf.Err = fmt.Errorf("Duplicate flag defined: %s", name)
		return nil
	}

	newFlag := &Flag{
		bf:       bf,
		name:     name,
		flagType: flagType,
	}
	bf.flags[name] = newFlag

	return newFlag
}
1349616
func (p *Partition) HasTagValue(name, key, value []byte) (bool, error) {
	fs, err := p.FileSet()
	if err != nil {
		return false, err
	}
	defer fs.Release()

	return fs.HasTagValue(name, key, value), nil
}
307632
func (fl *Flag) IsUsed() bool {
	if _, ok := fl.bf.used[fl.name]; ok {
		return true
	}
	return false
}
490445
func (a Attributes) Flag(flag string) bool {
	for _, v := range a {
		if v.Key == flag {
			return true
		}
	}
	return false
}
39539
func (c *Context) IsSet(name string) bool {
	if c.setFlags == nil {
		c.setFlags = make(map[string]bool)
		c.flagSet.Visit(func(f *flag.Flag) {
			c.setFlags[f.Name] = true
		})
	}
	return c.setFlags[name] == true
}
1335603
func (m *HeaderCtxFlag) WithFlag(ctx context.Context) context.Context {
	return context.WithValue(ctx, m, struct{}{})
}
954871
func MatchFlags(flags []string, c *imap.SearchCriteria) bool {
	flagsMap := make(map[string]bool)
	for _, f := range flags {
		flagsMap[f] = true
	}

	return matchFlags(flagsMap, c)
}
296223
func (f VerifyFlag) AddFlag(fset *pflag.FlagSet) (interface{}, error) {
	switch f.Type {
	case StringFlag:
		return fset.String(f.Name, "", f.Description), nil
	case BoolFlag:
		return fset.Bool(f.Name, false, f.Description), nil
	default:
		return nil, errors.Errorf("unrecognized flag type: %v", f.Type)
	}
}
428389
func hasTags(cmd *cobra.Command) bool {
	for curr := cmd; curr != nil; curr = curr.Parent() {
		if len(curr.Annotations) > 0 {
			return true
		}
	}

	return false
}