// Bool returns a bool from the ENV, or fallback variable
337256
func Bool(key string, fallback bool) bool {
	return DefaultClient.Bool(key, fallback)
}
806983
func (*GoFlags) Bool(o string, d bool, c string) *bool {
	return flag.Bool(o, d, c)
}
30241
func Bool(input interface{}) (output bool, err error) {
	switch castValue := input.(type) {
	case Booler:
		output = castValue.Bool()
		return
	case string:
		var errParse error
		output, errParse = strconv.ParseBool(castValue)
		if errParse != nil && len(castValue) > 0 {
			output = true
		}
		return
	case int:
		if castValue != 0 {
			output = true
		}
		return
	case int8:
		if castValue != 0 {
			output = true
		}
		return
	case int16:
		if castValue != 0 {
			output = true
		}
		return
	case int32:
		if castValue != 0 {
			output = true
		}
		return
	case int64:
		if castValue != 0 {
			output = true
		}
		return
	case uint:
		if castValue != 0 {
			output = true
		}
		return
	case uint8:
		if castValue != 0 {
			output = true
		}
		return
	case uint16:
		if castValue != 0 {
			output = true
		}
		return
	case uint32:
		if castValue != 0 {
			output = true
		}
		return
	case uint64:
		if castValue != 0 {
			output = true
		}
		return
	case float32:
		if castValue != 0 {
			output = true
		}
		return
	case float64:
		if castValue != 0 {
			output = true
		}
		return
	case bool:
		output = castValue
		return
	case nil:
		output = false
		return
	default:
		err = NewCastError("Could not convert to bool")
	}
	return
}
1244595
func (p *Prompt) Bool(q string, def bool) (bool, error) {
	w := &w{}
	w.print(p.output, colors.Default, q)
	str := "Y"
	if !def {
		str = "N"
	}
	w.print(p.output, p.defaultColor, "（", str, "）")
	w.print(p.output, colors.Default, "：")

	val := w.read(p)
	if w.err != nil {
		return false, w.err
	}

	switch strings.ToLower(val) {
	case "yes", "y":
		return true, nil
	case "no", "n":
		return false, nil
	default:
		return def, nil
	}
}
640428
func Bool(name string, value bool, usage string) *bool {
	return CommandLine.Bool(name, value, usage)
}
261802
func (c *Config) Bool(key string) (bool, error) {
	return strconv.ParseBool(c.get(key))
}
289603
func (c *ConfigFile) Bool(section, key string) (bool, error) {
	value, err := c.GetValue(section, key)
	if err != nil {
		return false, err
	}
	return strconv.ParseBool(value)
}
431882
func (m Memory) Bool() bool {
	b, err := strconv.ParseBool(string(m.Val))
	if err != nil {
		m.log.Debugf("could not convert memory to bool %s (%s, %s)",
			err, m.Key, string(m.Val))
	}
	return b
}
1300537
func (c *JSONConfigContainer) Bool(key string) (bool, error) {
	val := c.getData(key)
	if val != nil {
		return ParseBool(val)
	}
	return false, fmt.Errorf("not exist key: %q", key)
}
383763
func (r *Lexer) Bool() bool {
	if r.token.kind == tokenUndef && r.Ok() {
		r.FetchToken()
	}
	if !r.Ok() || r.token.kind != tokenBool {
		r.errInvalidToken("bool")
		return false
	}
	ret := r.token.boolValue
	r.consume()
	return ret
}
30235
func BoolP(name, shorthand string, value bool, usage string) *bool {
	return CommandLine.BoolP(name, shorthand, value, usage)
}
854675
func (self *Config) Bool(section string, option string) (value bool, err error) {
	sv, err := self.String(section, option)
	if err != nil {
		return false, err
	}

	value, ok := boolString[strings.ToLower(sv)]
	if !ok {
		return false, errors.New("could not parse bool value: " + sv)
	}

	return value, nil
}
193889
func (t Section) Bool(k string) bool {
	return t.values[k].BoolValue()
}
598913
func (b *QueryBuilder) Bool() *BoolQueryBuilder {
	if b.boolQueryBuilder == nil {
		b.boolQueryBuilder = NewBoolQueryBuilder()
	}
	return b.boolQueryBuilder
}
673226
func (h *HCL) Bool(name string) (bool, error) {
	v, err := h.value(name)
	if err != nil {
		return false, err
	}

	return v.(bool), nil
}
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
}
488144
func ParseBool(value string) (bool, error) {
	switch strings.ToLower(value) {
	case "yes", "yeah", "y", "true", "1", "on":
		return true, nil
	case "no", "nope", "n", "false", "0", "off":
		return false, nil
	default:
		return false, trace.BadParameter("unsupported value: %q", value)
	}
}