cli

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Commands []*Command
	Out      io.Writer
	Err      io.Writer
}

func (*App) Run

func (a *App) Run(args []string) error

type BoolFlag added in v0.32.0

type BoolFlag struct {
	Name        string
	Value       bool
	Description string
	Action      func(app RunState, s bool) error
	// contains filtered or unexported fields
}

type Command

type Command struct {
	Name        string
	Description string
	Aliases     []string
	Run         func(state *RunState) error
	Flags       []Flag
}

type DurationFlag added in v0.32.0

type DurationFlag struct {
	Name        string
	Value       time.Duration
	Description string
	Required    bool
	Action      func(app RunState, s time.Duration) error
	// contains filtered or unexported fields
}

type Flag added in v0.32.0

type Flag interface {
	// contains filtered or unexported methods
}

type Int64Flag added in v0.32.0

type Int64Flag struct {
	Name        string
	Value       int64
	Description string
	Required    bool
	Action      func(app RunState, s int64) error
	// contains filtered or unexported fields
}

type IntFlag added in v0.32.0

type IntFlag struct {
	Name        string
	Value       int
	Description string
	Required    bool
	Action      func(app RunState, s int) error
	// contains filtered or unexported fields
}

type RunState added in v0.21.0

type RunState struct {
	Out  io.Writer
	Err  io.Writer
	Args []string
	// contains filtered or unexported fields
}

func (RunState) Bool added in v0.32.0

func (rs RunState) Bool(flagName string) bool

func (RunState) Duration added in v0.32.0

func (rs RunState) Duration(flagName string) time.Duration

func (RunState) Int added in v0.32.0

func (rs RunState) Int(flagName string) int

func (RunState) Int64 added in v0.32.0

func (rs RunState) Int64(flagName string) int64

func (RunState) String added in v0.32.0

func (rs RunState) String(flagName string) string

type StringFlag added in v0.32.0

type StringFlag struct {
	Name        string
	Value       string
	Description string
	Required    bool
	Action      func(app RunState, s string) error
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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