package pflag

import (
	
	
	
)

// -- uintSlice Value
type uintSliceValue struct {
	value   *[]uint
	changed bool
}

func newUintSliceValue( []uint,  *[]uint) *uintSliceValue {
	 := new(uintSliceValue)
	.value = 
	*.value = 
	return 
}

func ( *uintSliceValue) ( string) error {
	 := strings.Split(, ",")
	 := make([]uint, len())
	for ,  := range  {
		,  := strconv.ParseUint(, 10, 0)
		if  != nil {
			return 
		}
		[] = uint()
	}
	if !.changed {
		*.value = 
	} else {
		*.value = append(*.value, ...)
	}
	.changed = true
	return nil
}

func ( *uintSliceValue) () string {
	return "uintSlice"
}

func ( *uintSliceValue) () string {
	 := make([]string, len(*.value))
	for ,  := range *.value {
		[] = fmt.Sprintf("%d", )
	}
	return "[" + strings.Join(, ",") + "]"
}

func ( *uintSliceValue) ( string) (uint, error) {
	,  := strconv.ParseUint(, 10, 0)
	if  != nil {
		return 0, 
	}
	return uint(), nil
}

func ( *uintSliceValue) ( uint) string {
	return fmt.Sprintf("%d", )
}

func ( *uintSliceValue) ( string) error {
	,  := .fromString()
	if  != nil {
		return 
	}
	*.value = append(*.value, )
	return nil
}

func ( *uintSliceValue) ( []string) error {
	 := make([]uint, len())
	for ,  := range  {
		var  error
		[],  = .fromString()
		if  != nil {
			return 
		}
	}
	*.value = 
	return nil
}

func ( *uintSliceValue) () []string {
	 := make([]string, len(*.value))
	for ,  := range *.value {
		[] = .toString()
	}
	return 
}

func uintSliceConv( string) (interface{}, error) {
	 = strings.Trim(, "[]")
	// Empty string would cause a slice with one (empty) entry
	if len() == 0 {
		return []uint{}, nil
	}
	 := strings.Split(, ",")
	 := make([]uint, len())
	for ,  := range  {
		,  := strconv.ParseUint(, 10, 0)
		if  != nil {
			return nil, 
		}
		[] = uint()
	}
	return , nil
}

// GetUintSlice returns the []uint value of a flag with the given name.
func ( *FlagSet) ( string) ([]uint, error) {
	,  := .getFlagType(, "uintSlice", uintSliceConv)
	if  != nil {
		return []uint{}, 
	}
	return .([]uint), nil
}

// UintSliceVar defines a uintSlice flag with specified name, default value, and usage string.
// The argument p points to a []uint variable in which to store the value of the flag.
func ( *FlagSet) ( *[]uint,  string,  []uint,  string) {
	.VarP(newUintSliceValue(, ), , "", )
}

// UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) ( *[]uint, ,  string,  []uint,  string) {
	.VarP(newUintSliceValue(, ), , , )
}

// UintSliceVar defines a uint[] flag with specified name, default value, and usage string.
// The argument p points to a uint[] variable in which to store the value of the flag.
func ( *[]uint,  string,  []uint,  string) {
	CommandLine.VarP(newUintSliceValue(, ), , "", )
}

// UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
func ( *[]uint, ,  string,  []uint,  string) {
	CommandLine.VarP(newUintSliceValue(, ), , , )
}

// UintSlice defines a []uint flag with specified name, default value, and usage string.
// The return value is the address of a []uint variable that stores the value of the flag.
func ( *FlagSet) ( string,  []uint,  string) *[]uint {
	 := []uint{}
	.UintSliceVarP(&, , "", , )
	return &
}

// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) (,  string,  []uint,  string) *[]uint {
	 := []uint{}
	.UintSliceVarP(&, , , , )
	return &
}

// UintSlice defines a []uint flag with specified name, default value, and usage string.
// The return value is the address of a []uint variable that stores the value of the flag.
func ( string,  []uint,  string) *[]uint {
	return CommandLine.UintSliceP(, "", , )
}

// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
func (,  string,  []uint,  string) *[]uint {
	return CommandLine.UintSliceP(, , , )
}