package pflag

import 

// optional interface to indicate boolean flags that can be
// supplied without "=value" text
type boolFlag interface {
	Value
	IsBoolFlag() bool
}

// -- bool Value
type boolValue bool

func newBoolValue( bool,  *bool) *boolValue {
	* = 
	return (*boolValue)()
}

func ( *boolValue) ( string) error {
	,  := strconv.ParseBool()
	* = boolValue()
	return 
}

func ( *boolValue) () string {
	return "bool"
}

func ( *boolValue) () string { return strconv.FormatBool(bool(*)) }

func ( *boolValue) () bool { return true }

func boolConv( string) (interface{}, error) {
	return strconv.ParseBool()
}

// GetBool return the bool value of a flag with the given name
func ( *FlagSet) ( string) (bool, error) {
	,  := .getFlagType(, "bool", boolConv)
	if  != nil {
		return false, 
	}
	return .(bool), nil
}

// BoolVar defines a bool flag with specified name, default value, and usage string.
// The argument p points to a bool variable in which to store the value of the flag.
func ( *FlagSet) ( *bool,  string,  bool,  string) {
	.BoolVarP(, , "", , )
}

// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) ( *bool, ,  string,  bool,  string) {
	 := .VarPF(newBoolValue(, ), , , )
	.NoOptDefVal = "true"
}

// BoolVar defines a bool flag with specified name, default value, and usage string.
// The argument p points to a bool variable in which to store the value of the flag.
func ( *bool,  string,  bool,  string) {
	BoolVarP(, , "", , )
}

// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.
func ( *bool, ,  string,  bool,  string) {
	 := CommandLine.VarPF(newBoolValue(, ), , , )
	.NoOptDefVal = "true"
}

// Bool 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.
func ( *FlagSet) ( string,  bool,  string) *bool {
	return .BoolP(, "", , )
}

// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) (,  string,  bool,  string) *bool {
	 := new(bool)
	.BoolVarP(, , , , )
	return 
}

// Bool 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.
func ( string,  bool,  string) *bool {
	return BoolP(, "", , )
}

// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash.
func (,  string,  bool,  string) *bool {
	 := CommandLine.BoolP(, , , )
	return 
}