argument.go 681 Bytes
Newer Older
1 2 3 4 5 6
package commands

type ArgumentType int

const (
	ArgString ArgumentType = iota
7
	ArgFile
8 9 10
)

type Argument struct {
11 12 13 14 15
	Name        string
	Type        ArgumentType
	Required    bool
	Variadic    bool
	Description string
16
}
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

func StringArg(name string, required, variadic bool, description string) Argument {
	return Argument{
		Name:        name,
		Type:        ArgString,
		Required:    required,
		Variadic:    variadic,
		Description: description,
	}
}

func FileArg(name string, required, variadic bool, description string) Argument {
	return Argument{
		Name:        name,
		Type:        ArgFile,
		Required:    required,
		Variadic:    variadic,
		Description: description,
	}
}