Documentation ¶
Index ¶
- Variables
- func ExitOnErr(err error)
- func ExitOnStderr(err error)
- func ExitOnStderrString(err string)
- func GetUsageString() string
- func Main()
- func MustGetCommandLineString(header string, obj interface{}) string
- func MustNewCommandLineFuncFromFuncV2(f interface{}) func()
- func MustRunCommandLineFromFuncV2(f interface{})
- func PrintUsageAndExit()
- func ProxyCommand(args ...string) func()
- func RunCommandLineFromFuncV3(req RunCommandLineFromFuncV3Request) (errMsg string)
- func WaitForExit()
- func WaitForExitOrCloser(closer *udwClose.Closer)
- type Command
- type CommandGroup
- func (g *CommandGroup) AddCommand(action Command) *CommandGroup
- func (g *CommandGroup) AddCommandWithName(name string, f interface{}) *CommandGroup
- func (g *CommandGroup) CompleteCmd(args []string) (waitSelectList []string)
- func (g *CommandGroup) HasCommand(name string) bool
- func (g *CommandGroup) Help()
- func (g *CommandGroup) Main()
- type CompletionFn
- type CreateCompletionReq
- type RunCommandLineFromFuncV3Request
Constants ¶
This section is empty.
Variables ¶
View Source
var VERSION = ""
Functions ¶
func ExitOnStderr ¶
func ExitOnStderr(err error)
func ExitOnStderrString ¶
func ExitOnStderrString(err string)
func GetUsageString ¶
func GetUsageString() string
func MustNewCommandLineFuncFromFuncV2 ¶
func MustNewCommandLineFuncFromFuncV2(f interface{}) func()
func MustRunCommandLineFromFuncV2 ¶
func MustRunCommandLineFromFuncV2(f interface{})
func PrintUsageAndExit ¶
func PrintUsageAndExit()
func ProxyCommand ¶
func ProxyCommand(args ...string) func()
func RunCommandLineFromFuncV3 ¶
func RunCommandLineFromFuncV3(req RunCommandLineFromFuncV3Request) (errMsg string)
func WaitForExit ¶
func WaitForExit()
func WaitForExitOrCloser ¶
Types ¶
type Command ¶
type Command struct { Name string Desc string Runner func() FuncV2 interface{} Hidden bool CompleteFn CompletionFn }
type CommandGroup ¶
type CommandGroup struct {
// contains filtered or unexported fields
}
func AddCommand ¶
func AddCommand(action Command) *CommandGroup
func AddCommandWithName ¶
func AddCommandWithName(name string, runner interface{}) *CommandGroup
func GetDefaultCommandGroup ¶
func GetDefaultCommandGroup() *CommandGroup
func NewCommandGroup ¶
func NewCommandGroup() *CommandGroup
func (*CommandGroup) AddCommand ¶
func (g *CommandGroup) AddCommand(action Command) *CommandGroup
func (*CommandGroup) AddCommandWithName ¶
func (g *CommandGroup) AddCommandWithName(name string, f interface{}) *CommandGroup
func (*CommandGroup) CompleteCmd ¶
func (g *CommandGroup) CompleteCmd(args []string) (waitSelectList []string)
func (*CommandGroup) HasCommand ¶
func (g *CommandGroup) HasCommand(name string) bool
func (*CommandGroup) Help ¶
func (g *CommandGroup) Help()
func (*CommandGroup) Main ¶
func (g *CommandGroup) Main()
type CompletionFn ¶
func CreateCompletion ¶
func CreateCompletion(req CreateCompletionReq) CompletionFn
type CreateCompletionReq ¶
type CreateCompletionReq struct { AfterArgListMap map[string][]string ReflectArgOfFunc interface{} SelfDefineFnList []CompletionFn }
type RunCommandLineFromFuncV3Request ¶
type RunCommandLineFromFuncV3Request struct { OsArgList []string F interface{} }
Click to show internal directories.
Click to hide internal directories.