func (a *Argument) SetArrayed() *Argument {
	a.Arrayed = true
	return a
}
SetArrayed the argument
package gcli
import (
	"fmt"
	"strconv"
	"strings"
	"github.com/gookit/goutil/strutil"
)
var emptyArg = &Argument{}
type Arguments struct {
	name string
	args []*Argument
	argsIndexes map[string]int
	validateNum bool
	hasArrayArg bool
	hasOptionalArg bool
}
func (ags *Arguments) SetName(name string) {
	ags.name = name
}
func (ags *Arguments) SetValidateNum(validateNum bool) {
	ags.validateNum = validateNum
}
func (ags *Arguments) ParseArgs(args []string) (err error) {
	var num int
	inNum := len(args)
	for i, arg := range ags.args {
		num = i + 1
		if num > inNum {  
			if arg.Required {
				return fmt.Errorf("must set value for the argument: %s(position#%d)", arg.ShowName, arg.index)
			}
			break
		}
		if arg.Arrayed {
			err = arg.bindValue(args[i:])
			inNum = num  
		} else {
			err = arg.bindValue(args[i])
		}
		if err != nil {
			return
		}
	}
	if ags.validateNum && inNum > num {
		return fmt.Errorf("entered too many arguments: %v", args[num:])
	}
	return
}
func (ags *Arguments) AddArg(name, desc string, requiredAndArrayed ...bool) *Argument {
	newArg := NewArgument(name, desc, requiredAndArrayed...)
	return ags.AddArgument(newArg)
}
func (ags *Arguments) AddArgByRule(name, rule string) *Argument {
	mp := parseSimpleRule(name, rule)
	required := strutil.MustBool(mp["required"])
	newArg := NewArgument(name, mp["desc"], required)
	if defVal := mp["default"]; defVal != "" {
		newArg.Value = defVal
	}
	return ags.AddArgument(newArg)
}
func (ags *Arguments) BindArg(arg *Argument) *Argument {
	return ags.AddArgument(arg)
}
func (ags *Arguments) AddArgument(arg *Argument) *Argument {
	if ags.argsIndexes == nil {
		ags.argsIndexes = make(map[string]int)
	}
	name := arg.goodArgument()
	if _, has := ags.argsIndexes[name]; has {
		panicf("the argument name '%s' already exists in command '%s'", name, ags.name)
	}
	if ags.hasArrayArg {
		panicf("have defined an array argument, you cannot add argument '%s'", name)
	}
	if arg.Required && ags.hasOptionalArg {
		panicf("required argument '%s' cannot be defined after optional argument", name)
	}
	arg.index = len(ags.args)
	ags.argsIndexes[name] = arg.index
	ags.args = append(ags.args, arg)
	if !arg.Required {
		ags.hasOptionalArg = true
	}
	if arg.Arrayed {
		ags.hasArrayArg = true
	}
	return arg
}
func (ags *Arguments) Args() []*Argument {
	return ags.args
}
func (ags *Arguments) HasArg(name string) bool {
	_, ok := ags.argsIndexes[name]
	return ok
}
func (ags *Arguments) HasArgs() bool {
	return len(ags.argsIndexes) > 0
}
func (ags *Arguments) HasArguments() bool {
	return len(ags.argsIndexes) > 0
}
func (ags *Arguments) Arg(name string) *Argument {
	i, ok := ags.argsIndexes[name]
	if !ok {
		return emptyArg
	}
	return ags.args[i]
}
func (ags *Arguments) ArgByIndex(i int) *Argument {
	if i < len(ags.args) {
		return ags.args[i]
	}
	return emptyArg
}
type Argument struct {
	Name string
	Desc string
	ShowName string
	Required bool
	Arrayed bool
	Value interface{}
	Handler func(val interface{}) interface{}
	Validator func(val interface{}) (interface{}, error)
	index int
}
func NewArgument(name, desc string, requiredAndArrayed ...bool) *Argument {
	var arrayed, required bool
	if ln := len(requiredAndArrayed); ln > 0 {
		required = requiredAndArrayed[0]
		if ln > 1 {
			arrayed = requiredAndArrayed[1]
		}
	}
	return &Argument{
		Name: name,
		Desc: desc,
		Required: required,
		Arrayed:  arrayed,
	}
}