commands

package
v1.52.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Registered = map[string]Command{}

Functions

func ParseArgs added in v1.45.1

func ParseArgs(ctx context.Context, cmd Command, argValues []string) (any, *flag.FlagSet, error)

func RegisterCommand

func RegisterCommand(sub Command)

Types

type Arg added in v1.45.1

type Arg struct {
	Name    string
	Desc    string
	Flag    string
	Default string
	Type    string
	Path    []string
	ExtType string
	// contains filtered or unexported fields
}

func ParseArgsType added in v1.45.1

func ParseArgsType(settings reflect.Value, path []string, without []string) ([]Arg, error)

func (*Arg) Set added in v1.45.1

func (a *Arg) Set(v string) error

func (*Arg) SetConnectInfo added in v1.45.1

func (a *Arg) SetConnectInfo(connectInfo *connectinfo.ConnectInfo)

func (*Arg) String added in v1.45.1

func (a *Arg) String() string

type Command

type Command interface {
	Name() string
	Description() string
	Settings() any
	Run(ctx context.Context, settings any) error
}

type StringSliceFlag added in v1.45.1

type StringSliceFlag struct {
	A *[]string
}

func (*StringSliceFlag) Set added in v1.45.1

func (s *StringSliceFlag) Set(v string) error

func (StringSliceFlag) String added in v1.45.1

func (s StringSliceFlag) String() string

Jump to

Keyboard shortcuts

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