// DefineBoolFlag defines a bool flag with specified name, default value, and usage string.
// The return value is the address of a bool variable that stores the value of the flag.
162820
func (cmd *CLI) DefineBoolFlag(name string, value bool, usage string) *bool {
	p := new(bool)
	cmd.DefineBoolFlagVar(p, name, value, usage)
	return p
}
340171
func GetBool(r *http.Request, name string, value bool) bool {
	switch r.FormValue(name) {
	case "", "0", "false":
		return false
	default:
		return true
	}
}
595948
func DefineDirFlag() {
	if flag.CommandLine.Lookup(DirFlag) == nil {
		flag.CommandLine.String(DirFlag, DirDefault, DirUsage)
	}
}
30235
func BoolP(name, shorthand string, value bool, usage string) *bool {
	return CommandLine.BoolP(name, shorthand, value, usage)
}
1290963
func (cmd *CLI) DefineIntFlag(name string, value int, usage string) *int {
	p := new(int)
	cmd.DefineIntFlagVar(p, name, value, usage)
	return p
}
222419
func Bool(short string, long string, value bool, usage string) *bool {
	flagVar := value
	return BoolVar(&flagVar, short, long, value, usage)
}
65654
func (b Bool) Bool() bool {
	if b.Initialized {
		return b.Val
	}
	return b.Default
}
1229469
func (v Value) Bool() (bool, error) {
	b, err := strconv.ParseBool(v.String())
	if err != nil {
		return false, v.invalidTypeError(err, "bool")
	}
	return b, nil
}
1013496
func optionalBool(arg []bool, defaultValue bool) bool {
	if len(arg) == 0 {
		return defaultValue
	}
	return arg[0]
}
709370
func (cmd *CLI) DefineFloat64Flag(name string, value float64, usage string) *float64 {
	p := new(float64)
	cmd.DefineFloat64FlagVar(p, name, value, usage)
	return p
}
412819
func urlFlag(usage string, required bool) cli.Flag {
	return newPlaceholder("url, u", "URL", usage, "", "TORUS_BOOTSTRAP_URL", required)
}
1114687
func (c *Context) Bool(name string) bool {
	return lookupBool(name, c.flagSet)
}
76031
func (e *Environment) Bool(name string) (bool, error) {
	v, err := e.value(name)
	if err != nil {
		return false, err
	}

	return strconv.ParseBool(v)
}
884075
func Bool(v interface{}, err error) (bool, error) {
	if err != nil {
		return false, err
	}
	vb, ok := v.(bool)
	if ok {
		return vb, nil
	}

	return false, newWrongTypeError(v, vb)

}
411366
func (j *JSON) Bool(name string) (bool, error) {
	v, err := j.value(name)
	if err != nil {
		return false, err
	}

	b, ok := v.(bool)
	if !ok {
		return false, errors.New("unable to cast")
	}

	return b, nil
}
546680
func BoolToBoolValueFunc() mapstructure.DecodeHookFunc {
	return func(
		f reflect.Type,
		t reflect.Type,
		data interface{}) (interface{}, error) {
		if f.Kind() != reflect.Bool {
			return data, nil
		}

		val := BoolValue{}
		if t != reflect.TypeOf(val) {
			return data, nil
		}

		val.v = new(bool)
		*(val.v) = data.(bool)
		return val, nil
	}
}
898647
func (b *Bool) BoolOr(or bool) bool {
	if b == nil {
		return or
	}
	if !b.Valid {
		return or
	}

	return b.Bool
}