package pflag

import (
	
)

// -- time.Duration Value
type durationValue time.Duration

func newDurationValue( time.Duration,  *time.Duration) *durationValue {
	* = 
	return (*durationValue)()
}

func ( *durationValue) ( string) error {
	,  := time.ParseDuration()
	* = durationValue()
	return 
}

func ( *durationValue) () string {
	return "duration"
}

func ( *durationValue) () string { return (*time.Duration)().String() }

func durationConv( string) (interface{}, error) {
	return time.ParseDuration()
}

// GetDuration return the duration value of a flag with the given name
func ( *FlagSet) ( string) (time.Duration, error) {
	,  := .getFlagType(, "duration", durationConv)
	if  != nil {
		return 0, 
	}
	return .(time.Duration), nil
}

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

// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) ( *time.Duration, ,  string,  time.Duration,  string) {
	.VarP(newDurationValue(, ), , , )
}

// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
// The argument p points to a time.Duration variable in which to store the value of the flag.
func ( *time.Duration,  string,  time.Duration,  string) {
	CommandLine.VarP(newDurationValue(, ), , "", )
}

// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash.
func ( *time.Duration, ,  string,  time.Duration,  string) {
	CommandLine.VarP(newDurationValue(, ), , , )
}

// Duration defines a time.Duration flag with specified name, default value, and usage string.
// The return value is the address of a time.Duration variable that stores the value of the flag.
func ( *FlagSet) ( string,  time.Duration,  string) *time.Duration {
	 := new(time.Duration)
	.DurationVarP(, , "", , )
	return 
}

// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) (,  string,  time.Duration,  string) *time.Duration {
	 := new(time.Duration)
	.DurationVarP(, , , , )
	return 
}

// Duration defines a time.Duration flag with specified name, default value, and usage string.
// The return value is the address of a time.Duration variable that stores the value of the flag.
func ( string,  time.Duration,  string) *time.Duration {
	return CommandLine.DurationP(, "", , )
}

// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash.
func (,  string,  time.Duration,  string) *time.Duration {
	return CommandLine.DurationP(, , , )
}