Documentation ¶
Index ¶
- Variables
- func AnalyseTemplate(tag I18nTag, data any) string
- func Ext_Max(l, r int) int
- func Ext_StringTo(value string) string
- func Ext_StringToValue(value string, kind reflect.Kind) (reflect.Value, error)
- func Ext_TypeIsArray(t reflect.Type) bool
- func Ext_TypeIsStruct(t reflect.Type) bool
- func NewInnerCommand(cmd Command) *innerCommand
- func UseEN()
- type AddCommandOption
- type App
- type AppBuilder
- type BaseCommand
- type Command
- type CommandMeta
- type CommandSettor
- type Context
- type Flag
- type GlobalFlag
- type HelpCommand
- type I18nTag
- type PipelineAction
- type PipelineSettings
- type Stdout
- type TempData_Meta
- type TempData_OutputCmdHelp
- type TempData_OutputSubCmdHelp
- type TempData_Version
- type UserSetFlags
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoField = errors.New("no field") ErrNotSupportFieldType = errors.New("not support field type") )
Functions ¶
func AnalyseTemplate ¶
func Ext_StringTo ¶
func Ext_StringToValue ¶
func Ext_TypeIsArray ¶
func Ext_TypeIsStruct ¶
func NewInnerCommand ¶
func NewInnerCommand(cmd Command) *innerCommand
Types ¶
type AddCommandOption ¶
type AddCommandOption func(CommandSettor)
type AppBuilder ¶
type AppBuilder interface { SetVersion(version string) AppBuilder SetUsage(usage string) AppBuilder SetPipeline(settings *PipelineSettings) AppBuilder AddCommand(Command, ...AddCommandOption) AppBuilder Build() App }
func NewBuilder ¶
func NewBuilder(name string) AppBuilder
type BaseCommand ¶
type BaseCommand struct { DefaultFlags any Meta *CommandMeta }
func (*BaseCommand) GetDefaultFlags ¶
func (cmd *BaseCommand) GetDefaultFlags() any
func (*BaseCommand) GetDescripton ¶
func (cmd *BaseCommand) GetDescripton() *CommandMeta
type Command ¶
type Command interface { GetDescripton() *CommandMeta GetDefaultFlags() any Action(c *Context) error }
type CommandMeta ¶
type CommandSettor ¶
type CommandSettor interface {
AddSucCommand(Command, ...AddCommandOption)
}
type GlobalFlag ¶
type GlobalFlag struct { *Flag Action PipelineAction }
type HelpCommand ¶
type HelpCommand struct { *BaseCommand // contains filtered or unexported fields }
func (*HelpCommand) Action ¶
func (cmd *HelpCommand) Action(c *Context) error
type I18nTag ¶
type I18nTag string
var ( I18n = map[I18nTag]string{} Tag_Default I18nTag = "default" Tag_OutputCmdHelp I18nTag = "output_cmd_help" Tag_OutputSubCmdHelp I18nTag = "output_sub_cmd_help" Tag_OutputVersion I18nTag = "output_version" Tag_HelpDescription I18nTag = "help_description" Tag_VersionDescription I18nTag = "version_description" )
type PipelineAction ¶
type PipelineSettings ¶ added in v1.0.1
type PipelineSettings struct { BeferCheckGlobalFlags []PipelineAction // 可以用来做一些初始化的工作 // contains filtered or unexported fields }
管道的配置
type TempData_Meta ¶
type TempData_OutputCmdHelp ¶
type TempData_OutputCmdHelp struct { Description string CmdPath string Flags []*TempData_Meta SupportGlobalFlag bool GlobalFlags []*TempData_Meta }
type TempData_OutputSubCmdHelp ¶
type TempData_OutputSubCmdHelp struct { Description string CmdPath string SubCommands []*TempData_Meta SupportGlobalFlag bool GlobalFlags []*TempData_Meta }
type TempData_Version ¶
type TempData_Version struct {
Version string
}
type UserSetFlags ¶
func (UserSetFlags) Range ¶
func (usfs UserSetFlags) Range(handler func(string, string))
func (UserSetFlags) Set ¶
func (usfs UserSetFlags) Set(key string, value string)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.