argument

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.3.7

type Action[T constraint.Argument] func(ctx *runtime.Context, value T) error

type Builder

type Builder[T constraint.Argument] struct {
	// contains filtered or unexported fields
}

func New

func New[T constraint.Argument](name string, target *T) *Builder[T]

func (*Builder[T]) Action

func (b *Builder[T]) Action(action Action[T]) (builder *Builder[T])

func (*Builder[T]) Addable

func (b *Builder[T]) Addable() (builder *Builder[T])

func (*Builder[T]) Aliases

func (b *Builder[T]) Aliases(aliases ...string) (builder *Builder[T])

func (*Builder[T]) Build

func (b *Builder[T]) Build() *Default[T]

func (*Builder[T]) Default

func (b *Builder[T]) Default(value T) (builder *Builder[T])

func (*Builder[T]) Environment

func (b *Builder[T]) Environment(environment ...string) (builder *Builder[T])

func (*Builder[T]) Hidden

func (b *Builder[T]) Hidden() (builder *Builder[T])

func (*Builder[T]) Required

func (b *Builder[T]) Required() (builder *Builder[T])

func (*Builder[T]) Text

func (b *Builder[T]) Text(text string) (builder *Builder[T])

func (*Builder[T]) Usage

func (b *Builder[T]) Usage(usage string) (builder *Builder[T])

type Default

type Default[T constraint.Argument] struct {
	// contains filtered or unexported fields
}

func NewDefault

func NewDefault[T constraint.Argument](name string, target *T) *Default[T]

func (*Default[T]) Aliases

func (d *Default[T]) Aliases() []string

func (*Default[T]) Default

func (d *Default[T]) Default() any

func (*Default[T]) Flag

func (d *Default[T]) Flag() (flag app.Flag)

func (*Default[T]) Hidden

func (d *Default[T]) Hidden() bool

func (*Default[T]) Name

func (d *Default[T]) Name() string

func (*Default[T]) Required

func (d *Default[T]) Required() bool

func (*Default[T]) Target

func (d *Default[T]) Target() any

func (*Default[T]) Text

func (d *Default[T]) Text() string

func (*Default[T]) Usage

func (d *Default[T]) Usage() string

Jump to

Keyboard shortcuts

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