Help us shape the future of Go! Take the 2026 Go Developer Survey

command

package
v1.20.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagTypeBool         = "bool"
	FlagTypeFloat64      = "float64"
	FlagTypeFloat64Slice = "float64_slice"
	FlagTypeInt          = "int"
	FlagTypeIntSlice     = "int_slice"
	FlagTypeInt64        = "int64"
	FlagTypeInt64Slice   = "int64_slice"
	FlagTypeString       = "string"
	FlagTypeStringSlice  = "string_slice"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument interface {
	GetMin() int
	GetMax() int
	GetName() string
	GetValue() any
}

type ArgumentBase

type ArgumentBase[T any] struct {
	Name     string // the name of this argument
	Default  T      // the default value of this argument
	Usage    string // the usage text to show
	Required bool   // if this argument is required
}

func (*ArgumentBase[T]) GetMax

func (a *ArgumentBase[T]) GetMax() int

func (*ArgumentBase[T]) GetMin

func (a *ArgumentBase[T]) GetMin() int

func (*ArgumentBase[T]) GetName

func (a *ArgumentBase[T]) GetName() string

func (*ArgumentBase[T]) GetValue

func (a *ArgumentBase[T]) GetValue() any

type ArgumentFloat32

type ArgumentFloat32 = ArgumentBase[float32]

type ArgumentFloat32Slice

type ArgumentFloat32Slice = ArgumentsBase[float32]

type ArgumentFloat64

type ArgumentFloat64 = ArgumentBase[float64]

type ArgumentFloat64Slice

type ArgumentFloat64Slice = ArgumentsBase[float64]

type ArgumentInt

type ArgumentInt = ArgumentBase[int]

type ArgumentInt8

type ArgumentInt8 = ArgumentBase[int8]

type ArgumentInt8Slice

type ArgumentInt8Slice = ArgumentsBase[int8]

type ArgumentInt16

type ArgumentInt16 = ArgumentBase[int16]

type ArgumentInt16Slice

type ArgumentInt16Slice = ArgumentsBase[int16]

type ArgumentInt32

type ArgumentInt32 = ArgumentBase[int32]

type ArgumentInt32Slice

type ArgumentInt32Slice = ArgumentsBase[int32]

type ArgumentInt64

type ArgumentInt64 = ArgumentBase[int64]

type ArgumentInt64Slice

type ArgumentInt64Slice = ArgumentsBase[int64]

type ArgumentIntSlice

type ArgumentIntSlice = ArgumentsBase[int]

type ArgumentString

type ArgumentString = ArgumentBase[string]

type ArgumentStringSlice

type ArgumentStringSlice = ArgumentsBase[string]

type ArgumentTimestamp

type ArgumentTimestamp struct {
	Name     string    // the name of this argument
	Value    time.Time // the default value of this argument
	Usage    string    // the usage text to show
	Required bool      // if this argument is required

	// Available layouts for timestamp value.
	// Note that value for formats with missing year/date will be interpreted as current year/date respectively.
	// Read more about time layouts: https://pkg.go.dev/time#pkg-constants
	Layouts []string
}

func (*ArgumentTimestamp) GetMax

func (a *ArgumentTimestamp) GetMax() int

func (*ArgumentTimestamp) GetMin

func (a *ArgumentTimestamp) GetMin() int

func (*ArgumentTimestamp) GetName

func (a *ArgumentTimestamp) GetName() string

func (*ArgumentTimestamp) GetValue

func (a *ArgumentTimestamp) GetValue() any

type ArgumentTimestampSlice

type ArgumentTimestampSlice struct {
	Name  string    // the name of this argument
	Value time.Time // the default value of this argument
	Usage string    // the usage text to show
	Min   int       // the min num of occurrences of this argument
	Max   int       // the max num of occurrences of this argument, set to -1 for unlimited

	// Available layouts for timestamp value.
	// Note that value for formats with missing year/date will be interpreted as current year/date respectively.
	// Read more about time layouts: https://pkg.go.dev/time#pkg-constants
	Layouts []string
}

func (*ArgumentTimestampSlice) GetMax

func (a *ArgumentTimestampSlice) GetMax() int

func (*ArgumentTimestampSlice) GetMin

func (a *ArgumentTimestampSlice) GetMin() int

func (*ArgumentTimestampSlice) GetName

func (a *ArgumentTimestampSlice) GetName() string

func (*ArgumentTimestampSlice) GetValue

func (a *ArgumentTimestampSlice) GetValue() any

type ArgumentUint

type ArgumentUint = ArgumentBase[uint]

type ArgumentUint8

type ArgumentUint8 = ArgumentBase[uint8]

type ArgumentUint8Slice

type ArgumentUint8Slice = ArgumentsBase[uint8]

type ArgumentUint16

type ArgumentUint16 = ArgumentBase[uint16]

type ArgumentUint16Slice

type ArgumentUint16Slice = ArgumentsBase[uint16]

type ArgumentUint32

type ArgumentUint32 = ArgumentBase[uint32]

type ArgumentUint32Slice

type ArgumentUint32Slice = ArgumentsBase[uint32]

type ArgumentUint64

type ArgumentUint64 = ArgumentBase[uint64]

type ArgumentUint64Slice

type ArgumentUint64Slice = ArgumentsBase[uint64]

type ArgumentUintSlice

type ArgumentUintSlice = ArgumentsBase[uint]

type ArgumentsBase

type ArgumentsBase[T any] struct {
	Name    string // the name of this argument
	Default []T    // the default value of this argument
	Usage   string // the usage text to show
	Min     int    // the min num of occurrences of this argument
	Max     int    // the max num of occurrences of this argument, set to -1 for unlimited
}

func (*ArgumentsBase[T]) GetMax

func (a *ArgumentsBase[T]) GetMax() int

func (*ArgumentsBase[T]) GetMin

func (a *ArgumentsBase[T]) GetMin() int

func (*ArgumentsBase[T]) GetName

func (a *ArgumentsBase[T]) GetName() string

func (*ArgumentsBase[T]) GetValue

func (a *ArgumentsBase[T]) GetValue() any

type BoolFlag

type BoolFlag struct {
	Name               string
	Usage              string
	Aliases            []string
	DisableDefaultText bool
	Required           bool
	Value              bool
}

func (*BoolFlag) Type

func (receiver *BoolFlag) Type() string

type Extend

type Extend struct {
	ArgsUsage string
	Category  string
	Flags     []Flag
	Arguments []Argument
}

type Flag

type Flag interface {
	// Type gets a flag type.
	Type() string
}

type Float64Flag

type Float64Flag struct {
	Name     string
	Usage    string
	Aliases  []string
	Value    float64
	Required bool
}

func (*Float64Flag) Type

func (receiver *Float64Flag) Type() string

type Float64SliceFlag

type Float64SliceFlag struct {
	Name     string
	Usage    string
	Aliases  []string
	Value    []float64
	Required bool
}

func (*Float64SliceFlag) Type

func (receiver *Float64SliceFlag) Type() string

type Int64Flag

type Int64Flag struct {
	Name     string
	Usage    string
	Aliases  []string
	Value    int64
	Required bool
}

func (*Int64Flag) Type

func (receiver *Int64Flag) Type() string

type Int64SliceFlag

type Int64SliceFlag struct {
	Name     string
	Usage    string
	Aliases  []string
	Value    []int64
	Required bool
}

func (*Int64SliceFlag) Type

func (receiver *Int64SliceFlag) Type() string

type IntFlag

type IntFlag struct {
	Name     string
	Usage    string
	Aliases  []string
	Value    int
	Required bool
}

func (*IntFlag) Type

func (receiver *IntFlag) Type() string

type IntSliceFlag

type IntSliceFlag struct {
	Name     string
	Usage    string
	Aliases  []string
	Value    []int
	Required bool
}

func (*IntSliceFlag) Type

func (receiver *IntSliceFlag) Type() string

type StringFlag

type StringFlag struct {
	Name     string
	Usage    string
	Value    string
	Aliases  []string
	Required bool
}

func (*StringFlag) Type

func (receiver *StringFlag) Type() string

type StringSliceFlag

type StringSliceFlag struct {
	Name     string
	Usage    string
	Aliases  []string
	Value    []string
	Required bool
}

func (*StringSliceFlag) Type

func (receiver *StringSliceFlag) Type() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL