command

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromFunc

func FromFunc(fn interface{}) (Command, ParentInfo, error)

func FromType

func FromType(t reflect.Type) (Command, ParentInfo, error)

Types

type Command

type Command struct {
	Func                reflect.Value
	Config              reflect.Type
	Description         string
	ExtendedDescription string
	Flags               []Flag
	PosArgs             []PosArg
	Trailing            PosArg
}

type Flag

type Flag struct {
	ShortName        string
	LongName         string
	Usage            string
	ExtendedUsage    string
	ValueName        string
	IsHelp           bool
	FieldIndex       []int
	AutocompleteFunc reflect.Value
}

type ParentInfo

type ParentInfo struct {
	ChildName          string
	ParentType         reflect.Type
	ParentIndexInChild int
}

type PosArg

type PosArg struct {
	Name             string
	FieldIndex       []int
	AutocompleteFunc reflect.Value
}

Jump to

Keyboard shortcuts

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