package pflag

import (
	
	
	
)

// -- int64Slice Value
type int64SliceValue struct {
	value   *[]int64
	changed bool
}

func newInt64SliceValue( []int64,  *[]int64) *int64SliceValue {
	 := new(int64SliceValue)
	.value = 
	*.value = 
	return 
}

func ( *int64SliceValue) ( string) error {
	 := strings.Split(, ",")
	 := make([]int64, len())
	for ,  := range  {
		var  error
		[],  = strconv.ParseInt(, 0, 64)
		if  != nil {
			return 
		}

	}
	if !.changed {
		*.value = 
	} else {
		*.value = append(*.value, ...)
	}
	.changed = true
	return nil
}

func ( *int64SliceValue) () string {
	return "int64Slice"
}

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

func ( *int64SliceValue) ( string) (int64, error) {
	return strconv.ParseInt(, 0, 64)
}

func ( *int64SliceValue) ( int64) string {
	return fmt.Sprintf("%d", )
}

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

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

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

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

	}
	return , nil
}

// GetInt64Slice return the []int64 value of a flag with the given name
func ( *FlagSet) ( string) ([]int64, error) {
	,  := .getFlagType(, "int64Slice", int64SliceConv)
	if  != nil {
		return []int64{}, 
	}
	return .([]int64), nil
}

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

// Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) ( *[]int64, ,  string,  []int64,  string) {
	.VarP(newInt64SliceValue(, ), , , )
}

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

// Int64SliceVarP is like Int64SliceVar, but accepts a shorthand letter that can be used after a single dash.
func ( *[]int64, ,  string,  []int64,  string) {
	CommandLine.VarP(newInt64SliceValue(, ), , , )
}

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

// Int64SliceP is like Int64Slice, but accepts a shorthand letter that can be used after a single dash.
func ( *FlagSet) (,  string,  []int64,  string) *[]int64 {
	 := []int64{}
	.Int64SliceVarP(&, , , , )
	return &
}

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

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