udwConsole

package
v0.0.0-...-f254aa5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 17 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var VERSION = ""

Functions

func ExitOnErr

func ExitOnErr(err error)

func ExitOnStderr

func ExitOnStderr(err error)

func ExitOnStderrString

func ExitOnStderrString(err string)

func GetUsageString

func GetUsageString() string

func Main

func Main()

func MustGetCommandLineString

func MustGetCommandLineString(header string, obj interface{}) 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

func WaitForExitOrCloser(closer *udwClose.Closer)

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

type CompletionFn func(args []string) (accept bool, waitSelect []string)

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{}
}

Jump to

Keyboard shortcuts

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