cli

package
v0.0.0-...-9f5860f Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorNotEnoughArguments

func ErrorNotEnoughArguments(s ...string) error

ErrorNotEnoughArguments -

func Text

func Text(text string) string

Text -

Types

type IElement

type IElement interface {
	IElementUniquePattern()
}

IElement -

func Doc

func Doc(text string) IElement

Doc -

func Hint

func Hint(text string) IElement

Hint -

func OnError

func OnError(arg interface{}) IElement

OnError -

func Usage

func Usage(text string) IElement

Usage -

type IOnError

type IOnError interface {
	HandleError(error) (string, error)
}

IOnError -

type IValue

type IValue interface {
	String() string
	Set(string) error
}

IValue -

type Interface

type Interface interface {
	IElement
	Parse(*[]string, string) (string, error)
	Do() (bool, error)
	GetKeys() []string
	GetBrief() string
	GetUsage() string
	GetHint() string
	GetDoc() string
	GetOption(tOptions) bool
}

Interface -

type TCommand

type TCommand struct {
	TFlag
	// contains filtered or unexported fields
}

TCommand -

func Command

func Command(desc string, fn func() error, elements ...IElement) *TCommand

Command -

func (*TCommand) Parse

func (o *TCommand) Parse(args *[]string, key string) (string, error)

Parse -

func (*TCommand) PrintHelp

func (o *TCommand) PrintHelp(args ...string) error

PrintHelp -

type TErrorNotEnoughArguments

type TErrorNotEnoughArguments struct {
	// contains filtered or unexported fields
}

TErrorNotEnoughArguments -

func (*TErrorNotEnoughArguments) Error

func (o *TErrorNotEnoughArguments) Error() string

type TFlag

type TFlag struct {
	IElement
	// contains filtered or unexported fields
}

TFlag -

func Flag

func Flag(desc string, variable interface{}, elements ...IElement) *TFlag

Flag -

func (*TFlag) Do

func (o *TFlag) Do() (bool, error)

Do -

func (*TFlag) GetBrief

func (o *TFlag) GetBrief() string

GetBrief -

func (*TFlag) GetDoc

func (o *TFlag) GetDoc() string

GetDoc -

func (*TFlag) GetHint

func (o *TFlag) GetHint() string

GetHint -

func (*TFlag) GetKeys

func (o *TFlag) GetKeys() []string

GetKeys -

func (*TFlag) GetOption

func (o *TFlag) GetOption(opt tOptions) bool

GetOption -

func (*TFlag) GetUsage

func (o *TFlag) GetUsage() string

GetUsage -

func (*TFlag) Parse

func (o *TFlag) Parse(args *[]string, key string) (string, error)

Parse -

func (*TFlag) Terminator

func (o *TFlag) Terminator() *TFlag

Terminator -

type TFlagSet

type TFlagSet struct {
	// contains filtered or unexported fields
}

TFlagSet -

func New

func New(brief string, fn func() error, elements ...IElement) *TFlagSet

New -

func (*TFlagSet) Doc

func (o *TFlagSet) Doc(text string) IElement

Doc -

func (*TFlagSet) Elements

func (o *TFlagSet) Elements(elements ...IElement) *TFlagSet

Elements -

func (*TFlagSet) GetHint

func (o *TFlagSet) GetHint() string

GetHint -

func (*TFlagSet) Hint

func (o *TFlagSet) Hint(text string) IElement

Hint -

func (*TFlagSet) Parse

func (o *TFlagSet) Parse(args []string) error

Parse -

func (*TFlagSet) PrintHelp

func (o *TFlagSet) PrintHelp() error

PrintHelp -

func (*TFlagSet) PrintHelpFunc

func (o *TFlagSet) PrintHelpFunc() func() error

PrintHelpFunc -

func (*TFlagSet) Usage

func (o *TFlagSet) Usage(text string) IElement

Usage -

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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