Documentation ¶
Index ¶
- Constants
- Variables
- func AddOnAfterXrefBuilt(cb HookXrefFunc)
- func AddOnBeforeXrefBuilding(cb HookXrefFunc)
- func AddOnConfigLoadedListener(c ConfigReloaded)
- func Clone(fromValue, toValue interface{}) interface{}
- func DumpAsString() (str string)
- func EnsureDir(dir string) (err error)
- func Exec(rootCmd *RootCommand) (err error)
- func ExecWith(rootCmd *RootCommand, beforeXrefBuildingX, afterXrefBuiltX HookXrefFunc) (err error)
- func FileExists(name string) bool
- func Get(key string) interface{}
- func GetBool(key string) bool
- func GetBoolP(prefix, key string) bool
- func GetBoolR(key string) bool
- func GetBoolRP(prefix, key string) bool
- func GetCurrentDir() string
- func GetDebugMode() bool
- func GetDuration(key string) time.Duration
- func GetDurationP(prefix, key string) time.Duration
- func GetDurationR(key string) time.Duration
- func GetDurationRP(prefix, key string) time.Duration
- func GetExcutableDir() string
- func GetExcutablePath() string
- func GetFloat32(key string) float32
- func GetFloat32P(prefix, key string) float32
- func GetFloat32R(key string) float32
- func GetFloat32RP(prefix, key string) float32
- func GetFloat64(key string) float64
- func GetFloat64P(prefix, key string) float64
- func GetFloat64R(key string) float64
- func GetFloat64RP(prefix, key string) float64
- func GetInt(key string) int
- func GetInt64(key string) int64
- func GetInt64P(prefix, key string) int64
- func GetInt64R(key string) int64
- func GetInt64RP(prefix, key string) int64
- func GetIntP(prefix, key string) int
- func GetIntR(key string) int
- func GetIntRP(prefix, key string) int
- func GetIntSlice(key string) []int
- func GetIntSliceP(prefix, key string) []int
- func GetIntSliceR(key string) []int
- func GetIntSliceRP(prefix, key string) []int
- func GetMap(key string) map[string]interface{}
- func GetMapR(key string) map[string]interface{}
- func GetPredefinedLocations() []string
- func GetQuietMode() bool
- func GetR(key string) interface{}
- func GetSectionFrom(sectionKeyPath string, holder interface{}) (err error)
- func GetStrictMode() bool
- func GetString(key string) string
- func GetStringP(prefix, key string) string
- func GetStringR(key string) string
- func GetStringRP(prefix, key string) string
- func GetStringSlice(key string) []string
- func GetStringSliceP(prefix, key string) []string
- func GetStringSliceR(key string) []string
- func GetStringSliceRP(prefix, key string) []string
- func GetUint(key string) uint
- func GetUint64(key string) uint64
- func GetUint64P(prefix, key string) uint64
- func GetUint64R(key string) uint64
- func GetUint64RP(prefix, key string) uint64
- func GetUintP(prefix, key string) uint
- func GetUintR(key string) uint
- func GetUintRP(prefix, key string) uint
- func GetUsedConfigFile() string
- func GetUsedConfigSubDir() string
- func GetVerboseMode() bool
- func InTesting() bool
- func InternalExecFor(rootCmd *RootCommand, args []string) (err error)
- func IsDigitHeavy(s string) bool
- func IsDirectory(path string) (bool, error)
- func IsRegularFile(path string) (bool, error)
- func Launch(cmd string, args ...string) (err error)
- func LaunchEditor(editor string) (content []byte, err error)
- func LaunchEditorWith(editor string, filename string) (content []byte, err error)
- func LoadConfigFile(file string) (err error)
- func NormalizeDir(s string) string
- func PrintBuildInfo()
- func RemoveOnConfigLoadedListener(c ConfigReloaded)
- func ResetOptions()
- func SaveAsJSON(filename string) (err error)
- func SaveAsToml(filename string) (err error)
- func SaveAsYaml(filename string) (err error)
- func SaveObjAsToml(obj interface{}, filename string) (err error)
- func Set(key string, val interface{})
- func SetCurrentHelpPainter(painter Painter)
- func SetCustomShowBuildInfo(fn func())
- func SetCustomShowVersion(fn func())
- func SetHelpTabStop(tabStop int)
- func SetInternalOutputStreams(out, err *bufio.Writer)
- func SetNoLoadConfigFiles(b bool)
- func SetNx(key string, val interface{})
- func SetOnConfigLoadedListener(c ConfigReloaded, enabled bool)
- func SetPredefinedLocations(locations []string)
- func SetUnknownOptionHandler(handler func(isFlag bool, title string, cmd *Command, args []string))
- func Soundex(s string) (snd4 string)
- func StripOrderPrefix(s string) string
- func WalkAllCommands(walk func(cmd *Command, index int) (err error)) (err error)
- func WrapWithRxxtPrefix(key string) string
- type BaseOpt
- func (s *BaseOpt) GetLongTitleNamesArray() []string
- func (s *BaseOpt) GetShortTitleNamesArray() []string
- func (s *BaseOpt) GetTitleName() string
- func (s *BaseOpt) GetTitleNames() string
- func (s *BaseOpt) GetTitleNamesArray() []string
- func (s *BaseOpt) GetTitleNamesBy(delimChar string) string
- func (s *BaseOpt) HasParent() bool
- type BoolOpt
- func (s *BoolOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *BoolOpt) Aliases(aliases ...string) (opt OptFlag)
- func (s *BoolOpt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *BoolOpt) Deprecated(deprecation string) (opt OptFlag)
- func (s *BoolOpt) Description(oneLine, long string) (opt OptFlag)
- func (s *BoolOpt) Examples(examples string) (opt OptFlag)
- func (s *BoolOpt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *BoolOpt) Group(group string) (opt OptFlag)
- func (s *BoolOpt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *BoolOpt) Hidden(hidden bool) (opt OptFlag)
- func (s *BoolOpt) Long(long string) (opt OptFlag)
- func (s *BoolOpt) OwnerCommand() (opt OptCmd)
- func (s *BoolOpt) RootCommand() (root *RootCommand)
- func (s *BoolOpt) SetOwner(opt OptCmd)
- func (s *BoolOpt) Short(short string) (opt OptFlag)
- func (s *BoolOpt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *BoolOpt) ToggleGroup(group string) (opt OptFlag)
- func (s *BoolOpt) ValidArgs(list ...string) (opt OptFlag)
- type CmdOpt
- func (s *CmdOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptCmd)
- func (s *CmdOpt) Aliases(aliases ...string) (opt OptCmd)
- func (s *CmdOpt) Bool() (opt OptFlag)
- func (s *CmdOpt) Deprecated(deprecation string) (opt OptCmd)
- func (s *CmdOpt) Description(oneLine, long string) (opt OptCmd)
- func (s *CmdOpt) Duration() (opt OptFlag)
- func (s *CmdOpt) Examples(examples string) (opt OptCmd)
- func (s *CmdOpt) Float32() (opt OptFlag)
- func (s *CmdOpt) Float64() (opt OptFlag)
- func (s *CmdOpt) Group(group string) (opt OptCmd)
- func (s *CmdOpt) Hidden(hidden bool) (opt OptCmd)
- func (s *CmdOpt) Int() (opt OptFlag)
- func (s *CmdOpt) Int64() (opt OptFlag)
- func (s *CmdOpt) IntSlice() (opt OptFlag)
- func (s *CmdOpt) Long(long string) (opt OptCmd)
- func (s *CmdOpt) NewFlag(typ OptFlagType) (opt OptFlag)
- func (s *CmdOpt) NewSubCommand() (opt OptCmd)
- func (s *CmdOpt) OwnerCommand() (opt OptCmd)
- func (s *CmdOpt) PostAction(pre func(cmd *Command, args []string)) (opt OptCmd)
- func (s *CmdOpt) PreAction(pre func(cmd *Command, args []string) (err error)) (opt OptCmd)
- func (s *CmdOpt) RootCommand() (root *RootCommand)
- func (s *CmdOpt) SetOwner(opt OptCmd)
- func (s *CmdOpt) Short(short string) (opt OptCmd)
- func (s *CmdOpt) String() (opt OptFlag)
- func (s *CmdOpt) StringSlice() (opt OptFlag)
- func (s *CmdOpt) TailPlaceholder(placeholder string) (opt OptCmd)
- func (s *CmdOpt) Titles(short, long string, aliases ...string) (opt OptCmd)
- func (s *CmdOpt) Uint() (opt OptFlag)
- func (s *CmdOpt) Uint64() (opt OptFlag)
- type Command
- func (c *Command) GetExpandableNames() string
- func (c *Command) GetExpandableNamesArray() []string
- func (c *Command) GetHitStr() string
- func (c *Command) GetName() string
- func (c *Command) GetOwner() *Command
- func (c *Command) GetParentName() string
- func (c *Command) GetQuotedGroupName() string
- func (c *Command) GetRoot() *RootCommand
- func (c *Command) GetSubCommandNamesBy(delimChar string) string
- func (c *Command) IsRoot() bool
- func (c *Command) PrintHelp(justFlags bool)
- func (c *Command) PrintVersion()
- type ConfigReloaded
- type Copier
- type CopierImpl
- type DurationOpt
- func (s *DurationOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *DurationOpt) Aliases(aliases ...string) (opt OptFlag)
- func (s *DurationOpt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *DurationOpt) Deprecated(deprecation string) (opt OptFlag)
- func (s *DurationOpt) Description(oneLine, long string) (opt OptFlag)
- func (s *DurationOpt) Examples(examples string) (opt OptFlag)
- func (s *DurationOpt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *DurationOpt) Group(group string) (opt OptFlag)
- func (s *DurationOpt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *DurationOpt) Hidden(hidden bool) (opt OptFlag)
- func (s *DurationOpt) Long(long string) (opt OptFlag)
- func (s *DurationOpt) OwnerCommand() (opt OptCmd)
- func (s *DurationOpt) RootCommand() (root *RootCommand)
- func (s *DurationOpt) SetOwner(opt OptCmd)
- func (s *DurationOpt) Short(short string) (opt OptFlag)
- func (s *DurationOpt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *DurationOpt) ToggleGroup(group string) (opt OptFlag)
- func (s *DurationOpt) ValidArgs(list ...string) (opt OptFlag)
- type ErrorForCmdr
- type Flag
- func (s *Flag) GetDescZsh() (desc string)
- func (s *Flag) GetTitleFlagNames() string
- func (s *Flag) GetTitleFlagNamesBy(delimChar string) string
- func (s *Flag) GetTitleFlagNamesByMax(delimChar string, maxCount int) string
- func (s *Flag) GetTitleZshFlagName() (str string)
- func (s *Flag) GetTitleZshFlagNames(delimChar string) (str string)
- func (s *Flag) GetTitleZshFlagNamesArray() (ary []string)
- type Float32Opt
- func (s *Float32Opt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *Float32Opt) Aliases(aliases ...string) (opt OptFlag)
- func (s *Float32Opt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *Float32Opt) Deprecated(deprecation string) (opt OptFlag)
- func (s *Float32Opt) Description(oneLine, long string) (opt OptFlag)
- func (s *Float32Opt) Examples(examples string) (opt OptFlag)
- func (s *Float32Opt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *Float32Opt) Group(group string) (opt OptFlag)
- func (s *Float32Opt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *Float32Opt) Hidden(hidden bool) (opt OptFlag)
- func (s *Float32Opt) Long(long string) (opt OptFlag)
- func (s *Float32Opt) OwnerCommand() (opt OptCmd)
- func (s *Float32Opt) RootCommand() (root *RootCommand)
- func (s *Float32Opt) SetOwner(opt OptCmd)
- func (s *Float32Opt) Short(short string) (opt OptFlag)
- func (s *Float32Opt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *Float32Opt) ToggleGroup(group string) (opt OptFlag)
- func (s *Float32Opt) ValidArgs(list ...string) (opt OptFlag)
- type Float64Opt
- func (s *Float64Opt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *Float64Opt) Aliases(aliases ...string) (opt OptFlag)
- func (s *Float64Opt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *Float64Opt) Deprecated(deprecation string) (opt OptFlag)
- func (s *Float64Opt) Description(oneLine, long string) (opt OptFlag)
- func (s *Float64Opt) Examples(examples string) (opt OptFlag)
- func (s *Float64Opt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *Float64Opt) Group(group string) (opt OptFlag)
- func (s *Float64Opt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *Float64Opt) Hidden(hidden bool) (opt OptFlag)
- func (s *Float64Opt) Long(long string) (opt OptFlag)
- func (s *Float64Opt) OwnerCommand() (opt OptCmd)
- func (s *Float64Opt) RootCommand() (root *RootCommand)
- func (s *Float64Opt) SetOwner(opt OptCmd)
- func (s *Float64Opt) Short(short string) (opt OptFlag)
- func (s *Float64Opt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *Float64Opt) ToggleGroup(group string) (opt OptFlag)
- func (s *Float64Opt) ValidArgs(list ...string) (opt OptFlag)
- type HookXrefFunc
- type Int64Opt
- func (s *Int64Opt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *Int64Opt) Aliases(aliases ...string) (opt OptFlag)
- func (s *Int64Opt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *Int64Opt) Deprecated(deprecation string) (opt OptFlag)
- func (s *Int64Opt) Description(oneLine, long string) (opt OptFlag)
- func (s *Int64Opt) Examples(examples string) (opt OptFlag)
- func (s *Int64Opt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *Int64Opt) Group(group string) (opt OptFlag)
- func (s *Int64Opt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *Int64Opt) Hidden(hidden bool) (opt OptFlag)
- func (s *Int64Opt) Long(long string) (opt OptFlag)
- func (s *Int64Opt) OwnerCommand() (opt OptCmd)
- func (s *Int64Opt) RootCommand() (root *RootCommand)
- func (s *Int64Opt) SetOwner(opt OptCmd)
- func (s *Int64Opt) Short(short string) (opt OptFlag)
- func (s *Int64Opt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *Int64Opt) ToggleGroup(group string) (opt OptFlag)
- func (s *Int64Opt) ValidArgs(list ...string) (opt OptFlag)
- type IntOpt
- func (s *IntOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *IntOpt) Aliases(aliases ...string) (opt OptFlag)
- func (s *IntOpt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *IntOpt) Deprecated(deprecation string) (opt OptFlag)
- func (s *IntOpt) Description(oneLine, long string) (opt OptFlag)
- func (s *IntOpt) Examples(examples string) (opt OptFlag)
- func (s *IntOpt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *IntOpt) Group(group string) (opt OptFlag)
- func (s *IntOpt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *IntOpt) Hidden(hidden bool) (opt OptFlag)
- func (s *IntOpt) Long(long string) (opt OptFlag)
- func (s *IntOpt) OwnerCommand() (opt OptCmd)
- func (s *IntOpt) RootCommand() (root *RootCommand)
- func (s *IntOpt) SetOwner(opt OptCmd)
- func (s *IntOpt) Short(short string) (opt OptFlag)
- func (s *IntOpt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *IntOpt) ToggleGroup(group string) (opt OptFlag)
- func (s *IntOpt) ValidArgs(list ...string) (opt OptFlag)
- type IntSliceOpt
- func (s *IntSliceOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *IntSliceOpt) Aliases(aliases ...string) (opt OptFlag)
- func (s *IntSliceOpt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *IntSliceOpt) Deprecated(deprecation string) (opt OptFlag)
- func (s *IntSliceOpt) Description(oneLine, long string) (opt OptFlag)
- func (s *IntSliceOpt) Examples(examples string) (opt OptFlag)
- func (s *IntSliceOpt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *IntSliceOpt) Group(group string) (opt OptFlag)
- func (s *IntSliceOpt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *IntSliceOpt) Hidden(hidden bool) (opt OptFlag)
- func (s *IntSliceOpt) Long(long string) (opt OptFlag)
- func (s *IntSliceOpt) OwnerCommand() (opt OptCmd)
- func (s *IntSliceOpt) RootCommand() (root *RootCommand)
- func (s *IntSliceOpt) SetOwner(opt OptCmd)
- func (s *IntSliceOpt) Short(short string) (opt OptFlag)
- func (s *IntSliceOpt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *IntSliceOpt) ToggleGroup(group string) (opt OptFlag)
- func (s *IntSliceOpt) ValidArgs(list ...string) (opt OptFlag)
- type Opt
- type OptCmd
- type OptFlag
- func NewBool() (opt OptFlag)
- func NewDuration() (opt OptFlag)
- func NewFloat32() (opt OptFlag)
- func NewFloat64() (opt OptFlag)
- func NewInt() (opt OptFlag)
- func NewInt64() (opt OptFlag)
- func NewIntSlice() (opt OptFlag)
- func NewString() (opt OptFlag)
- func NewStringSlice() (opt OptFlag)
- func NewUint() (opt OptFlag)
- func NewUint64() (opt OptFlag)
- type OptFlagType
- type Options
- func (s *Options) DumpAsString() (str string)
- func (s *Options) Get(key string) interface{}
- func (s *Options) GetBool(key string) (ret bool)
- func (s *Options) GetDuration(key string) (ir time.Duration)
- func (s *Options) GetFloat32(key string) (ir float32)
- func (s *Options) GetFloat64(key string) (ir float64)
- func (s *Options) GetHierarchyList() map[string]interface{}
- func (s *Options) GetInt(key string) (ir int64)
- func (s *Options) GetIntSlice(key string) (ir []int)
- func (s *Options) GetMap(key string) map[string]interface{}
- func (s *Options) GetString(key string) (ret string)
- func (s *Options) GetStringSlice(key string) (ir []string)
- func (s *Options) GetUint(key string) (ir uint64)
- func (s *Options) LoadConfigFile(file string) (err error)
- func (s *Options) Reset()
- func (s *Options) Set(key string, val interface{})
- func (s *Options) SetNx(key string, val interface{})
- type Painter
- type RootCmdOpt
- func (s *RootCmdOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptCmd)
- func (s *RootCmdOpt) Aliases(aliases ...string) (opt OptCmd)
- func (s *RootCmdOpt) Bool() (opt OptFlag)
- func (s *RootCmdOpt) Copyright(copyright, author string) *RootCmdOpt
- func (s *RootCmdOpt) Deprecated(deprecation string) (opt OptCmd)
- func (s *RootCmdOpt) Description(oneLine, long string) (opt OptCmd)
- func (s *RootCmdOpt) Duration() (opt OptFlag)
- func (s *RootCmdOpt) Examples(examples string) (opt OptCmd)
- func (s *RootCmdOpt) Float32() (opt OptFlag)
- func (s *RootCmdOpt) Float64() (opt OptFlag)
- func (s *RootCmdOpt) Group(group string) (opt OptCmd)
- func (s *RootCmdOpt) Header(header string) *RootCmdOpt
- func (s *RootCmdOpt) Hidden(hidden bool) (opt OptCmd)
- func (s *RootCmdOpt) Int() (opt OptFlag)
- func (s *RootCmdOpt) Int64() (opt OptFlag)
- func (s *RootCmdOpt) IntSlice() (opt OptFlag)
- func (s *RootCmdOpt) Long(long string) (opt OptCmd)
- func (s *RootCmdOpt) NewFlag(typ OptFlagType) (opt OptFlag)
- func (s *RootCmdOpt) NewSubCommand() (opt OptCmd)
- func (s *RootCmdOpt) OwnerCommand() (opt OptCmd)
- func (s *RootCmdOpt) PostAction(pre func(cmd *Command, args []string)) (opt OptCmd)
- func (s *RootCmdOpt) PreAction(pre func(cmd *Command, args []string) (err error)) (opt OptCmd)
- func (s *RootCmdOpt) RootCommand() (root *RootCommand)
- func (s *RootCmdOpt) SetOwner(opt OptCmd)
- func (s *RootCmdOpt) Short(short string) (opt OptCmd)
- func (s *RootCmdOpt) String() (opt OptFlag)
- func (s *RootCmdOpt) StringSlice() (opt OptFlag)
- func (s *RootCmdOpt) TailPlaceholder(placeholder string) (opt OptCmd)
- func (s *RootCmdOpt) Titles(short, long string, aliases ...string) (opt OptCmd)
- func (s *RootCmdOpt) Uint() (opt OptFlag)
- func (s *RootCmdOpt) Uint64() (opt OptFlag)
- type RootCommand
- type StringOpt
- func (s *StringOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *StringOpt) Aliases(aliases ...string) (opt OptFlag)
- func (s *StringOpt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *StringOpt) Deprecated(deprecation string) (opt OptFlag)
- func (s *StringOpt) Description(oneLine, long string) (opt OptFlag)
- func (s *StringOpt) Examples(examples string) (opt OptFlag)
- func (s *StringOpt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *StringOpt) Group(group string) (opt OptFlag)
- func (s *StringOpt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *StringOpt) Hidden(hidden bool) (opt OptFlag)
- func (s *StringOpt) Long(long string) (opt OptFlag)
- func (s *StringOpt) OwnerCommand() (opt OptCmd)
- func (s *StringOpt) RootCommand() (root *RootCommand)
- func (s *StringOpt) SetOwner(opt OptCmd)
- func (s *StringOpt) Short(short string) (opt OptFlag)
- func (s *StringOpt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *StringOpt) ToggleGroup(group string) (opt OptFlag)
- func (s *StringOpt) ValidArgs(list ...string) (opt OptFlag)
- type StringSliceOpt
- func (s *StringSliceOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *StringSliceOpt) Aliases(aliases ...string) (opt OptFlag)
- func (s *StringSliceOpt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *StringSliceOpt) Deprecated(deprecation string) (opt OptFlag)
- func (s *StringSliceOpt) Description(oneLine, long string) (opt OptFlag)
- func (s *StringSliceOpt) Examples(examples string) (opt OptFlag)
- func (s *StringSliceOpt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *StringSliceOpt) Group(group string) (opt OptFlag)
- func (s *StringSliceOpt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *StringSliceOpt) Hidden(hidden bool) (opt OptFlag)
- func (s *StringSliceOpt) Long(long string) (opt OptFlag)
- func (s *StringSliceOpt) OwnerCommand() (opt OptCmd)
- func (s *StringSliceOpt) RootCommand() (root *RootCommand)
- func (s *StringSliceOpt) SetOwner(opt OptCmd)
- func (s *StringSliceOpt) Short(short string) (opt OptFlag)
- func (s *StringSliceOpt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *StringSliceOpt) ToggleGroup(group string) (opt OptFlag)
- func (s *StringSliceOpt) ValidArgs(list ...string) (opt OptFlag)
- type SubCmdOpt
- func (s *SubCmdOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptCmd)
- func (s *SubCmdOpt) Aliases(aliases ...string) (opt OptCmd)
- func (s *SubCmdOpt) Bool() (opt OptFlag)
- func (s *SubCmdOpt) Deprecated(deprecation string) (opt OptCmd)
- func (s *SubCmdOpt) Description(oneLine, long string) (opt OptCmd)
- func (s *SubCmdOpt) Duration() (opt OptFlag)
- func (s *SubCmdOpt) Examples(examples string) (opt OptCmd)
- func (s *SubCmdOpt) Float32() (opt OptFlag)
- func (s *SubCmdOpt) Float64() (opt OptFlag)
- func (s *SubCmdOpt) Group(group string) (opt OptCmd)
- func (s *SubCmdOpt) Hidden(hidden bool) (opt OptCmd)
- func (s *SubCmdOpt) Int() (opt OptFlag)
- func (s *SubCmdOpt) Int64() (opt OptFlag)
- func (s *SubCmdOpt) IntSlice() (opt OptFlag)
- func (s *SubCmdOpt) Long(long string) (opt OptCmd)
- func (s *SubCmdOpt) NewFlag(typ OptFlagType) (opt OptFlag)
- func (s *SubCmdOpt) NewSubCommand() (opt OptCmd)
- func (s *SubCmdOpt) OwnerCommand() (opt OptCmd)
- func (s *SubCmdOpt) PostAction(pre func(cmd *Command, args []string)) (opt OptCmd)
- func (s *SubCmdOpt) PreAction(pre func(cmd *Command, args []string) (err error)) (opt OptCmd)
- func (s *SubCmdOpt) RootCommand() (root *RootCommand)
- func (s *SubCmdOpt) SetOwner(opt OptCmd)
- func (s *SubCmdOpt) Short(short string) (opt OptCmd)
- func (s *SubCmdOpt) String() (opt OptFlag)
- func (s *SubCmdOpt) StringSlice() (opt OptFlag)
- func (s *SubCmdOpt) TailPlaceholder(placeholder string) (opt OptCmd)
- func (s *SubCmdOpt) Titles(short, long string, aliases ...string) (opt OptCmd)
- func (s *SubCmdOpt) Uint() (opt OptFlag)
- func (s *SubCmdOpt) Uint64() (opt OptFlag)
- type Uint64Opt
- func (s *Uint64Opt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *Uint64Opt) Aliases(aliases ...string) (opt OptFlag)
- func (s *Uint64Opt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *Uint64Opt) Deprecated(deprecation string) (opt OptFlag)
- func (s *Uint64Opt) Description(oneLine, long string) (opt OptFlag)
- func (s *Uint64Opt) Examples(examples string) (opt OptFlag)
- func (s *Uint64Opt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *Uint64Opt) Group(group string) (opt OptFlag)
- func (s *Uint64Opt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *Uint64Opt) Hidden(hidden bool) (opt OptFlag)
- func (s *Uint64Opt) Long(long string) (opt OptFlag)
- func (s *Uint64Opt) OwnerCommand() (opt OptCmd)
- func (s *Uint64Opt) RootCommand() (root *RootCommand)
- func (s *Uint64Opt) SetOwner(opt OptCmd)
- func (s *Uint64Opt) Short(short string) (opt OptFlag)
- func (s *Uint64Opt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *Uint64Opt) ToggleGroup(group string) (opt OptFlag)
- func (s *Uint64Opt) ValidArgs(list ...string) (opt OptFlag)
- type UintOpt
- func (s *UintOpt) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag)
- func (s *UintOpt) Aliases(aliases ...string) (opt OptFlag)
- func (s *UintOpt) DefaultValue(val interface{}, placeholder string) (opt OptFlag)
- func (s *UintOpt) Deprecated(deprecation string) (opt OptFlag)
- func (s *UintOpt) Description(oneLine, long string) (opt OptFlag)
- func (s *UintOpt) Examples(examples string) (opt OptFlag)
- func (s *UintOpt) ExternalTool(envKeyName string) (opt OptFlag)
- func (s *UintOpt) Group(group string) (opt OptFlag)
- func (s *UintOpt) HeadLike(enable bool, min, max int64) (opt OptFlag)
- func (s *UintOpt) Hidden(hidden bool) (opt OptFlag)
- func (s *UintOpt) Long(long string) (opt OptFlag)
- func (s *UintOpt) OwnerCommand() (opt OptCmd)
- func (s *UintOpt) RootCommand() (root *RootCommand)
- func (s *UintOpt) SetOwner(opt OptCmd)
- func (s *UintOpt) Short(short string) (opt OptFlag)
- func (s *UintOpt) Titles(short, long string, aliases ...string) (opt OptFlag)
- func (s *UintOpt) ToggleGroup(group string) (opt OptFlag)
- func (s *UintOpt) ValidArgs(list ...string) (opt OptFlag)
Constants ¶
const ( // UnsortedGroup for commands and flags UnsortedGroup = "zzzz.unsorted" // SysMgmtGroup for commands and flags SysMgmtGroup = "zzz9.Misc" // DefaultEditor is 'vim' DefaultEditor = "vim" // ExternalToolEditor environment variable name, EDITOR is fit for most of shells. ExternalToolEditor = "EDITOR" // ExternalToolPasswordInput enables secure password input without echo. ExternalToolPasswordInput = "PASSWD" )
const ( // AppName const AppName = "cmdr" // main app-name // Version const Version = "1.0.1" // version name // VersionInt const VersionInt = 0x010001 // using as )
const ( // FgBlack terminal color code FgBlack = 30 // FgRed terminal color code FgRed = 31 // FgGreen terminal color code FgGreen = 32 // FgYellow terminal color code FgYellow = 33 // FgBlue terminal color code FgBlue = 34 // FgMagenta terminal color code FgMagenta = 35 // FgCyan terminal color code FgCyan = 36 // FgLightGray terminal color code FgLightGray = 37 // FgDarkGray terminal color code FgDarkGray = 90 // FgLightRed terminal color code FgLightRed = 91 // FgLightGreen terminal color code FgLightGreen = 92 // FgLightYellow terminal color code FgLightYellow = 93 // FgLightBlue terminal color code FgLightBlue = 94 // FgLightMagenta terminal color code FgLightMagenta = 95 // FgLightCyan terminal color code FgLightCyan = 96 // FgWhite terminal color code FgWhite = 97 // BgNormal terminal color code BgNormal = 0 // BgBoldOrBright terminal color code BgBoldOrBright = 1 // BgDim terminal color code BgDim = 2 // BgItalic terminal color code BgItalic = 3 // BgUnderline terminal color code BgUnderline = 4 // BgUlink terminal color code BgUlink = 5 // BgHidden terminal color code BgHidden = 8 // DarkColor terminal color code DarkColor = FgLightGray )
Variables ¶
var ( // GormDefaultCopier used for gorm GormDefaultCopier = &CopierImpl{true, true, true} // StandardCopier is a normal copier StandardCopier = &CopierImpl{false, false, false} )
var ( // EnableVersionCommands supports injecting the default `--version` flags and commands EnableVersionCommands = true // EnableHelpCommands supports injecting the default `--help` flags and commands EnableHelpCommands = true // EnableVerboseCommands supports injecting the default `--verbose` flags and commands EnableVerboseCommands = true // EnableCmdrCommands support these flags: `--strict-mode`, `--no-env-overrides` EnableCmdrCommands = true // EnableGenerateCommands supports injecting the default `generate` commands and subcommands EnableGenerateCommands = true // RxxtPrefix create a top-level namespace, which contains all normalized `Flag`s. RxxtPrefix = []string{"app"} // EnvPrefix attaches a prefix to key to retrieve the option value. EnvPrefix = []string{"CMDR"} // CurrentDescColor the print color for description line CurrentDescColor = FgDarkGray // CurrentDefaultValueColor the print color for default value line CurrentDefaultValueColor = FgDarkGray // CurrentGroupTitleColor the print color for titles CurrentGroupTitleColor = DarkColor // GetEditor sets callback to get editor program GetEditor func() (string, error) // ErrShouldBeStopException tips `Exec()` cancelled the following actions after `PreAction()` ErrShouldBeStopException = errors.New("should be stop right now") // ShouldIgnoreWrongEnumValue will be put into `cmdrError.Ignorable` while wrong enumerable value found in parsing command-line options. // main program might decide whether it's a warning or error. // see also: [Flag.ValidArgs] ShouldIgnoreWrongEnumValue = false )
var SavedOsArgs []string
SavedOsArgs is a copy of os.Args, just for testing
Functions ¶
func AddOnAfterXrefBuilt ¶ added in v0.2.11
func AddOnAfterXrefBuilt(cb HookXrefFunc)
AddOnAfterXrefBuilt add hook func
func AddOnBeforeXrefBuilding ¶ added in v0.2.11
func AddOnBeforeXrefBuilding(cb HookXrefFunc)
AddOnBeforeXrefBuilding add hook func
func AddOnConfigLoadedListener ¶
func AddOnConfigLoadedListener(c ConfigReloaded)
AddOnConfigLoadedListener add an functor on config loaded and merged
func Clone ¶ added in v0.2.3
func Clone(fromValue, toValue interface{}) interface{}
Clone deep copy source to target
func ExecWith ¶ added in v0.2.11
func ExecWith(rootCmd *RootCommand, beforeXrefBuildingX, afterXrefBuiltX HookXrefFunc) (err error)
ExecWith is main entry of `cmdr`.
func FileExists ¶
FileExists returns the existence of an directory or file
func Get ¶
func Get(key string) interface{}
Get returns the generic value of an `Option` key with WrapWithRxxtPrefix. Such as: ```golang cmdr.Get("app.logger.level") => 'DEBUG',... ```
func GetBool ¶
GetBool returns the bool value of an `Option` key. Such as: ```golang cmdr.Get("app.logger.enable") => true,... ```
func GetBoolP ¶ added in v0.2.3
GetBoolP returns the bool value of an `Option` key. Such as: ```golang cmdr.GetP("app.logger", "enable") => true,... ```
func GetBoolR ¶ added in v0.2.23
GetBoolR returns the bool value of an `Option` key with WrapWithRxxtPrefix. Such as: ```golang cmdr.GetBoolR("logger.enable") => true,... ```
func GetBoolRP ¶ added in v0.2.23
GetBoolRP returns the bool value of an `Option` key with WrapWithRxxtPrefix. Such as: ```golang cmdr.GetBoolRP("logger", "enable") => true,... ```
func GetCurrentDir ¶
func GetCurrentDir() string
GetCurrentDir returns the current workingFlag directory
func GetDebugMode ¶ added in v0.2.5
func GetDebugMode() bool
GetDebugMode returns the flag value of `--debug`/`-D`
func GetDuration ¶ added in v0.2.19
GetDuration returns the int slice value of an `Option` key.
func GetDurationP ¶ added in v0.2.19
GetDurationP returns the int slice value of an `Option` key.
func GetDurationR ¶ added in v1.0.0
GetDurationR returns the int slice value of an `Option` key.
func GetDurationRP ¶ added in v1.0.0
GetDurationRP returns the int slice value of an `Option` key.
func GetExcutableDir ¶
func GetExcutableDir() string
GetExcutableDir returns the executable file directory
func GetExcutablePath ¶ added in v0.2.13
func GetExcutablePath() string
GetExcutablePath returns the executable file path
func GetFloat32 ¶ added in v1.0.1
GetFloat32 returns the float32 value of an `Option` key.
func GetFloat32P ¶ added in v1.0.1
GetFloat32P returns the float32 value of an `Option` key.
func GetFloat32R ¶ added in v1.0.1
GetFloat32R returns the float32 value of an `Option` key with WrapWithRxxtPrefix.
func GetFloat32RP ¶ added in v1.0.1
GetFloat32RP returns the float32 value of an `Option` key with WrapWithRxxtPrefix.
func GetFloat64 ¶ added in v1.0.1
GetFloat64 returns the float64 value of an `Option` key.
func GetFloat64P ¶ added in v1.0.1
GetFloat64P returns the float64 value of an `Option` key.
func GetFloat64R ¶ added in v1.0.1
GetFloat64R returns the float64 value of an `Option` key with WrapWithRxxtPrefix.
func GetFloat64RP ¶ added in v1.0.1
GetFloat64RP returns the float64 value of an `Option` key with WrapWithRxxtPrefix.
func GetInt64R ¶ added in v0.2.23
GetInt64R returns the int64 value of an `Option` key with WrapWithRxxtPrefix.
func GetInt64RP ¶ added in v0.2.23
GetInt64RP returns the int64 value of an `Option` key with WrapWithRxxtPrefix.
func GetIntR ¶ added in v0.2.23
GetIntR returns the int value of an `Option` key with WrapWithRxxtPrefix.
func GetIntRP ¶ added in v0.2.23
GetIntRP returns the int value of an `Option` key with WrapWithRxxtPrefix.
func GetIntSlice ¶ added in v0.2.19
GetIntSlice returns the int slice value of an `Option` key.
func GetIntSliceP ¶ added in v0.2.19
GetIntSliceP returns the int slice value of an `Option` key.
func GetIntSliceR ¶ added in v0.2.23
GetIntSliceR returns the int slice value of an `Option` key with WrapWithRxxtPrefix.
func GetIntSliceRP ¶ added in v0.2.23
GetIntSliceRP returns the int slice value of an `Option` key with WrapWithRxxtPrefix.
func GetMapR ¶ added in v1.0.0
GetMapR an `Option` by key string with WrapWithRxxtPrefix, it returns a hierarchy map or nil
func GetPredefinedLocations ¶ added in v0.2.5
func GetPredefinedLocations() []string
GetPredefinedLocations return the searching locations for loading config files.
func GetQuietMode ¶ added in v0.2.5
func GetQuietMode() bool
GetQuietMode returns the flag value of `--quiet`/`-q`
func GetR ¶ added in v0.2.23
func GetR(key string) interface{}
GetR returns the generic value of an `Option` key with WrapWithRxxtPrefix. Such as: ```golang cmdr.GetR("logger.level") => 'DEBUG',... ```
func GetSectionFrom ¶ added in v1.0.1
GetSectionFrom returns error while cannot yaml Marshal and Unmarshal `cmdr.GetSectionFrom(sectionKeyPath, &holder)` could load all sub-tree nodes from sectionKeyPath and transform them into holder structure, such as: ```go
type ServerConfig struct { Port int HttpMode int EnableTls bool } var serverConfig = new(ServerConfig) cmdr.GetSectionFrom("server", &serverConfig) assert serverConfig.Port == 7100
```
func GetStrictMode ¶ added in v0.2.5
func GetStrictMode() bool
GetStrictMode enables error when opt value missed. such as: xxx a b --prefix” => error: prefix opt has no value specified. xxx a b --prefix'/' => ok.
ENV: use `CMDR_APP_STRICT_MODE=true` to enable strict-mode. NOTE: `CMDR_APP_` prefix could be set by user (via: `EnvPrefix` && `RxxtPrefix`).
the flag value of `--strict-mode`.
func GetStringP ¶ added in v0.2.3
GetStringP returns the string value of an `Option` key.
func GetStringR ¶ added in v0.2.23
GetStringR returns the string value of an `Option` key with WrapWithRxxtPrefix.
func GetStringRP ¶ added in v0.2.23
GetStringRP returns the string value of an `Option` key with WrapWithRxxtPrefix.
func GetStringSlice ¶
GetStringSlice returns the string slice value of an `Option` key.
func GetStringSliceP ¶ added in v0.2.3
GetStringSliceP returns the string slice value of an `Option` key.
func GetStringSliceR ¶ added in v0.2.23
GetStringSliceR returns the string slice value of an `Option` key with WrapWithRxxtPrefix.
func GetStringSliceRP ¶ added in v0.2.23
GetStringSliceRP returns the string slice value of an `Option` key with WrapWithRxxtPrefix.
func GetUint64P ¶ added in v0.2.3
GetUint64P returns the uint64 value of an `Option` key.
func GetUint64R ¶ added in v0.2.23
GetUint64R returns the uint64 value of an `Option` key with WrapWithRxxtPrefix.
func GetUint64RP ¶ added in v0.2.23
GetUint64RP returns the uint64 value of an `Option` key with WrapWithRxxtPrefix.
func GetUintR ¶ added in v0.2.23
GetUintR returns the uint value of an `Option` key with WrapWithRxxtPrefix.
func GetUintRP ¶ added in v0.2.23
GetUintRP returns the uint value of an `Option` key with WrapWithRxxtPrefix.
func GetUsedConfigFile ¶ added in v0.2.3
func GetUsedConfigFile() string
GetUsedConfigFile returns the main config filename (generally it's `<appname>.yml`)
func GetUsedConfigSubDir ¶ added in v0.2.3
func GetUsedConfigSubDir() string
GetUsedConfigSubDir returns the sub-directory `conf.d` of config files
func GetVerboseMode ¶ added in v0.2.5
func GetVerboseMode() bool
GetVerboseMode returns the flag value of `--verbose`/`-v`
func InTesting ¶ added in v0.2.19
func InTesting() bool
InTesting detects whether is running under go test mode
func InternalExecFor ¶ added in v0.2.3
func InternalExecFor(rootCmd *RootCommand, args []string) (err error)
InternalExecFor is an internal helper, esp for debugging
func IsDigitHeavy ¶ added in v1.0.2
IsDigitHeavy tests if the whole string is digit
func IsDirectory ¶ added in v0.2.21
IsDirectory tests whether `path` is a directory or not
func IsRegularFile ¶ added in v0.2.21
IsRegularFile tests whether `path` is a normal regular file or not
func Launch ¶ added in v0.2.13
Launch executes a command setting both standard input, output and error.
func LaunchEditor ¶ added in v0.2.13
LaunchEditor launches the specified editor
func LaunchEditorWith ¶ added in v0.2.19
LaunchEditorWith launches the specified editor with a filename
func LoadConfigFile ¶
LoadConfigFile Load a yaml config file and merge the settings into `rxxtOptions` and load files in the `conf.d` child directory too.
func NormalizeDir ¶ added in v0.2.19
NormalizeDir make dir name normalized
func PrintBuildInfo ¶ added in v0.2.19
func PrintBuildInfo()
PrintBuildInfo print building information
func RemoveOnConfigLoadedListener ¶
func RemoveOnConfigLoadedListener(c ConfigReloaded)
RemoveOnConfigLoadedListener remove an functor on config loaded and merged
func ResetOptions ¶ added in v0.2.19
func ResetOptions()
ResetOptions to reset the exists `Options`, so that you could follow a `LoadConfigFile()` with it.
func SaveAsJSON ¶ added in v0.2.17
SaveAsJSON to Save all config entries as a json file
func SaveAsToml ¶ added in v0.2.17
SaveAsToml to Save all config entries as a toml file
func SaveAsYaml ¶ added in v0.2.17
SaveAsYaml to Save all config entries as a yaml file
func SaveObjAsToml ¶ added in v0.2.19
SaveObjAsToml to Save an object as a toml file
func Set ¶ added in v0.2.3
func Set(key string, val interface{})
Set set the value of an `Option` key (with prefix auto-wrap). The key MUST not have an `app` prefix. eg: ```golang cmdr.Set("logger.level", "DEBUG") cmdr.Set("ms.tags.port", 8500) ... cmdr.Set("debug", true) cmdr.GetBool("app.debug") => true ```
func SetCurrentHelpPainter ¶ added in v0.2.23
func SetCurrentHelpPainter(painter Painter)
SetCurrentHelpPainter allows to change the behavior and facade of help screen.
func SetCustomShowBuildInfo ¶ added in v0.2.3
func SetCustomShowBuildInfo(fn func())
SetCustomShowBuildInfo supports your `ShowBuildInfo()` instead of internal `showBuildInfo()`
func SetCustomShowVersion ¶ added in v0.2.3
func SetCustomShowVersion(fn func())
SetCustomShowVersion supports your `ShowVersion()` instead of internal `showVersion()`
func SetHelpTabStop ¶ added in v1.0.0
func SetHelpTabStop(tabStop int)
SetHelpTabStop sets the tab stop for help screen output
func SetInternalOutputStreams ¶ added in v0.2.3
SetInternalOutputStreams sets the internal output streams for debugging
func SetNoLoadConfigFiles ¶ added in v0.2.21
func SetNoLoadConfigFiles(b bool)
SetNoLoadConfigFiles true means no loading config files
func SetNx ¶ added in v0.2.3
func SetNx(key string, val interface{})
SetNx but without prefix auto-wrapped. `rxxtPrefix` is a string slice to define the prefix string array, default is ["app"]. So, cmdr.Set("debug", true) will put an real entry with (`app.debug`, true).
func SetOnConfigLoadedListener ¶
func SetOnConfigLoadedListener(c ConfigReloaded, enabled bool)
SetOnConfigLoadedListener enable/disable an functor on config loaded and merged
func SetPredefinedLocations ¶ added in v0.2.5
func SetPredefinedLocations(locations []string)
SetPredefinedLocations to customize the searching locations for loading config files. It MUST be invoked before `cmdr.Exec`. Such as: ```go
SetPredefinedLocations([]string{"./config", "~/.config/cmdr/", "$GOPATH/running-configs/cmdr"})
```
func SetUnknownOptionHandler ¶ added in v0.2.23
SetUnknownOptionHandler enables your customized wrong command/flag processor. internal processor supports smart suggestions for those wrong commands and flags.
func Soundex ¶ added in v0.2.25
Soundex returns the english word's soundex value, such as: 'tags' => 't322'
func StripOrderPrefix ¶ added in v0.2.9
StripOrderPrefix strips the prefix string fragment for sorting order. see also: Command.Group, Flag.Group, ...
func WalkAllCommands ¶ added in v0.2.9
WalkAllCommands loops for all commands, starting from root.
func WrapWithRxxtPrefix ¶ added in v0.2.23
WrapWithRxxtPrefix wrap an key with RxxtPrefix, for [GetXxx(key)] and [GetXxxP(prefix,key)]
Types ¶
type BaseOpt ¶
type BaseOpt struct { Name string // single char. example for flag: "a" -> "-a" // Short rune. Short string // word string. example for flag: "addr" -> "--addr" Full string // more synonyms Aliases []string // group name Group string Description string LongDescription string Examples string Hidden bool // Deprecated is a version string just like '0.5.9', that means this command/flag was/will be deprecated since `v0.5.9`. Deprecated string // Action is callback for the last recognized command/sub-command. // return: ErrShouldBeStopException will break the following flow and exit right now // cmd 是 flag 被识别时已经得到的子命令 Action func(cmd *Command, args []string) (err error) // contains filtered or unexported fields }
BaseOpt is base of `Command`, `Flag`
func (*BaseOpt) GetLongTitleNamesArray ¶ added in v0.2.3
GetLongTitleNamesArray returns long name and aliases as an array
func (*BaseOpt) GetShortTitleNamesArray ¶ added in v0.2.3
GetShortTitleNamesArray returns short name as an array
func (*BaseOpt) GetTitleName ¶
GetTitleName returns name/full/short string
func (*BaseOpt) GetTitleNames ¶
GetTitleNames return the joint string of short,full,aliases names
func (*BaseOpt) GetTitleNamesArray ¶
GetTitleNamesArray returns short,full,aliases names
func (*BaseOpt) GetTitleNamesBy ¶
GetTitleNamesBy returns the joint string of short,full,aliases names
type BoolOpt ¶ added in v0.2.15
type BoolOpt struct {
// contains filtered or unexported fields
}
BoolOpt for fluent api
func (*BoolOpt) DefaultValue ¶ added in v0.2.15
func (*BoolOpt) Deprecated ¶ added in v0.2.15
func (*BoolOpt) Description ¶ added in v0.2.15
func (*BoolOpt) ExternalTool ¶ added in v0.2.15
func (*BoolOpt) OwnerCommand ¶ added in v0.2.15
func (s *BoolOpt) OwnerCommand() (opt OptCmd)
func (*BoolOpt) RootCommand ¶ added in v0.2.15
func (s *BoolOpt) RootCommand() (root *RootCommand)
func (*BoolOpt) ToggleGroup ¶ added in v0.2.15
type CmdOpt ¶ added in v0.2.15
type CmdOpt struct {
// contains filtered or unexported fields
}
CmdOpt for fluent api
func (*CmdOpt) Deprecated ¶ added in v0.2.15
func (*CmdOpt) Description ¶ added in v0.2.15
func (*CmdOpt) NewFlag ¶ added in v0.2.15
func (s *CmdOpt) NewFlag(typ OptFlagType) (opt OptFlag)
func (*CmdOpt) NewSubCommand ¶ added in v0.2.15
func (s *CmdOpt) NewSubCommand() (opt OptCmd)
func (*CmdOpt) OwnerCommand ¶ added in v0.2.15
func (s *CmdOpt) OwnerCommand() (opt OptCmd)
func (*CmdOpt) PostAction ¶ added in v0.2.15
func (*CmdOpt) RootCommand ¶ added in v0.2.15
func (s *CmdOpt) RootCommand() (root *RootCommand)
func (*CmdOpt) StringSlice ¶ added in v0.2.15
func (s *CmdOpt) StringSlice() (opt OptFlag)
func (*CmdOpt) TailPlaceholder ¶ added in v0.2.15
type Command ¶
type Command struct { BaseOpt Flags []*Flag SubCommands []*Command // return: ErrShouldBeStopException will break the following flow and exit right now PreAction func(cmd *Command, args []string) (err error) // PostAction will be run after Action() invoked. PostAction func(cmd *Command, args []string) // be shown at tail of command usages line. Such as for TailPlaceHolder="<host-fqdn> <ipv4/6>": // austr dns add <host-fqdn> <ipv4/6> [Options] [Parent/Global Options] TailPlaceHolder string // contains filtered or unexported fields }
Command holds the structure of commands and subcommands
func FindSubCommand ¶ added in v0.2.17
FindSubCommand find sub-command with `longName` from `cmd`
func FindSubCommandRecursive ¶ added in v0.2.17
FindSubCommandRecursive find sub-command with `longName` from `cmd` recursively
func (*Command) GetExpandableNames ¶
GetExpandableNames returns the names comma splitted string.
func (*Command) GetExpandableNamesArray ¶
GetExpandableNamesArray returns the names array of command, includes short name and long name.
func (*Command) GetParentName ¶
GetParentName returns the owner command name
func (*Command) GetQuotedGroupName ¶
GetQuotedGroupName returns the group name quoted string.
func (*Command) GetRoot ¶
func (c *Command) GetRoot() *RootCommand
GetRoot returns the `RootCommand`
func (*Command) GetSubCommandNamesBy ¶
GetSubCommandNamesBy returns the joint string of subcommands
func (*Command) PrintVersion ¶
func (c *Command) PrintVersion()
PrintVersion prints versions information
type ConfigReloaded ¶
type ConfigReloaded interface {
OnConfigReloaded()
}
ConfigReloaded for config reloaded
type Copier ¶ added in v0.2.3
type Copier interface {
Copy(toValue interface{}, fromValue interface{}, ignoreNames ...string) (err error)
}
Copier interface Copier is based on from github.com/jinzhu/copier
type CopierImpl ¶ added in v0.2.3
type CopierImpl struct { KeepIfFromIsNil bool // 源字段值为nil指针时,目标字段的值保持不变 ZeroIfEqualsFrom bool // 源和目标字段值相同时,目标字段被清除为未初始化的零值 KeepIfFromIsZero bool // 源字段值为未初始化的零值时,目标字段的值保持不变 // 此条尚未实现 }
CopierImpl impl
func (*CopierImpl) Copy ¶ added in v0.2.3
func (s *CopierImpl) Copy(toValue interface{}, fromValue interface{}, ignoreNames ...string) (err error)
Copy copy things
type DurationOpt ¶ added in v0.2.17
type DurationOpt struct {
// contains filtered or unexported fields
}
DurationOpt for fluent api
func (*DurationOpt) DefaultValue ¶ added in v0.2.17
func (*DurationOpt) Deprecated ¶ added in v0.2.17
func (*DurationOpt) Description ¶ added in v0.2.17
func (*DurationOpt) ExternalTool ¶ added in v0.2.17
func (*DurationOpt) OwnerCommand ¶ added in v0.2.17
func (s *DurationOpt) OwnerCommand() (opt OptCmd)
func (*DurationOpt) RootCommand ¶ added in v0.2.17
func (s *DurationOpt) RootCommand() (root *RootCommand)
func (*DurationOpt) ToggleGroup ¶ added in v0.2.17
type ErrorForCmdr ¶ added in v1.0.2
ErrorForCmdr structure
func NewError ¶ added in v1.0.2
func NewError(ignorable bool, inner error, args ...interface{}) *ErrorForCmdr
NewError formats a ErrorForCmdr object
func NewErrorWithMsg ¶ added in v1.0.2
func NewErrorWithMsg(msg string, inner error) *ErrorForCmdr
NewErrorWithMsg formats a ErrorForCmdr object
func (*ErrorForCmdr) Error ¶ added in v1.0.2
func (s *ErrorForCmdr) Error() string
type Flag ¶
type Flag struct { BaseOpt // ToggleGroup: to-do: Toggle Group ToggleGroup string // DefaultValuePlaceholder for flag DefaultValuePlaceholder string // DefaultValue default value for flag DefaultValue interface{} // ValidArgs to-do ValidArgs []string // Required to-do Required bool // ExternalTool to get the value text by invoking external tool // It's an environment variable name, such as: "EDITOR" (or cmdr.ExternalToolEditor) ExternalTool string // HeadLike enables a free-hand option like `head -3`. // // When a free-hand option presents, it'll be treated as a named option with an integer value. // // For example, option/flag = `{{Full:"line",Short:"l"},HeadLike:true}`, the command line: // `app -3` // is equivalent to `app -l 3`, and so on. // // HeadLike assumed an named option with an integer value, that means, Min and Max can be applied on it too. // NOTE: Only one head-like option can be defined in a command/sub-command chain. HeadLike bool // Min minimal value of a range. Min int64 // Max maximal value of a range. Max int64 // PostAction treat this flag as a command! PostAction func(cmd *Command, args []string) (err error) }
Flag means a flag, a option, or a opt.
func FindFlagRecursive ¶ added in v0.2.17
FindFlagRecursive find flag with `longName` from `cmd` recursively
func (*Flag) GetDescZsh ¶ added in v0.2.13
GetDescZsh temp
func (*Flag) GetTitleFlagNames ¶ added in v0.2.13
GetTitleFlagNames temp
func (*Flag) GetTitleFlagNamesBy ¶ added in v0.2.13
GetTitleFlagNamesBy temp
func (*Flag) GetTitleFlagNamesByMax ¶ added in v0.2.13
GetTitleFlagNamesByMax temp
func (*Flag) GetTitleZshFlagName ¶ added in v0.2.13
GetTitleZshFlagName temp
func (*Flag) GetTitleZshFlagNames ¶ added in v0.2.13
GetTitleZshFlagNames temp
func (*Flag) GetTitleZshFlagNamesArray ¶ added in v0.2.13
GetTitleZshFlagNamesArray temp
type Float32Opt ¶ added in v1.0.1
type Float32Opt struct {
// contains filtered or unexported fields
}
Float32Opt for fluent api
func (*Float32Opt) DefaultValue ¶ added in v1.0.1
func (*Float32Opt) Deprecated ¶ added in v1.0.1
func (*Float32Opt) Description ¶ added in v1.0.1
func (*Float32Opt) ExternalTool ¶ added in v1.0.1
func (*Float32Opt) OwnerCommand ¶ added in v1.0.1
func (s *Float32Opt) OwnerCommand() (opt OptCmd)
func (*Float32Opt) RootCommand ¶ added in v1.0.1
func (s *Float32Opt) RootCommand() (root *RootCommand)
func (*Float32Opt) ToggleGroup ¶ added in v1.0.1
type Float64Opt ¶ added in v1.0.1
type Float64Opt struct {
// contains filtered or unexported fields
}
Float64Opt for fluent api
func (*Float64Opt) DefaultValue ¶ added in v1.0.1
func (*Float64Opt) Deprecated ¶ added in v1.0.1
func (*Float64Opt) Description ¶ added in v1.0.1
func (*Float64Opt) ExternalTool ¶ added in v1.0.1
func (*Float64Opt) OwnerCommand ¶ added in v1.0.1
func (s *Float64Opt) OwnerCommand() (opt OptCmd)
func (*Float64Opt) RootCommand ¶ added in v1.0.1
func (s *Float64Opt) RootCommand() (root *RootCommand)
func (*Float64Opt) ToggleGroup ¶ added in v1.0.1
type HookXrefFunc ¶ added in v0.2.11
type HookXrefFunc func(root *RootCommand, args []string)
HookXrefFunc the hook function prototype for SetBeforeXrefBuilding and SetAfterXrefBuilt
type Int64Opt ¶ added in v0.2.15
type Int64Opt struct {
// contains filtered or unexported fields
}
Int64Opt for fluent api
func (*Int64Opt) DefaultValue ¶ added in v0.2.15
func (*Int64Opt) Deprecated ¶ added in v0.2.15
func (*Int64Opt) Description ¶ added in v0.2.15
func (*Int64Opt) ExternalTool ¶ added in v0.2.15
func (*Int64Opt) OwnerCommand ¶ added in v0.2.15
func (s *Int64Opt) OwnerCommand() (opt OptCmd)
func (*Int64Opt) RootCommand ¶ added in v0.2.15
func (s *Int64Opt) RootCommand() (root *RootCommand)
func (*Int64Opt) ToggleGroup ¶ added in v0.2.15
type IntOpt ¶ added in v0.2.15
type IntOpt struct {
// contains filtered or unexported fields
}
IntOpt for fluent api
func (*IntOpt) DefaultValue ¶ added in v0.2.15
func (*IntOpt) Deprecated ¶ added in v0.2.15
func (*IntOpt) Description ¶ added in v0.2.15
func (*IntOpt) ExternalTool ¶ added in v0.2.15
func (*IntOpt) OwnerCommand ¶ added in v0.2.15
func (s *IntOpt) OwnerCommand() (opt OptCmd)
func (*IntOpt) RootCommand ¶ added in v0.2.15
func (s *IntOpt) RootCommand() (root *RootCommand)
func (*IntOpt) ToggleGroup ¶ added in v0.2.15
type IntSliceOpt ¶ added in v0.2.15
type IntSliceOpt struct {
// contains filtered or unexported fields
}
IntSliceOpt for fluent api
func (*IntSliceOpt) DefaultValue ¶ added in v0.2.15
func (*IntSliceOpt) Deprecated ¶ added in v0.2.15
func (*IntSliceOpt) Description ¶ added in v0.2.15
func (*IntSliceOpt) ExternalTool ¶ added in v0.2.15
func (*IntSliceOpt) OwnerCommand ¶ added in v0.2.15
func (s *IntSliceOpt) OwnerCommand() (opt OptCmd)
func (*IntSliceOpt) RootCommand ¶ added in v0.2.15
func (s *IntSliceOpt) RootCommand() (root *RootCommand)
func (*IntSliceOpt) ToggleGroup ¶ added in v0.2.15
type Opt ¶ added in v0.2.15
type Opt interface { Titles(short, long string, aliases ...string) (opt Opt) Short(short string) (opt Opt) Long(long string) (opt Opt) Aliases(ss ...string) (opt Opt) Description(oneLine, long string) (opt Opt) Examples(examples string) (opt Opt) Group(group string) (opt Opt) Hidden(hidden bool) (opt Opt) Deprecated(deprecation string) (opt Opt) Action(action func(cmd *Command, args []string) (err error)) (opt Opt) }
Opt never used?
type OptCmd ¶ added in v0.2.15
type OptCmd interface { Titles(short, long string, aliases ...string) (opt OptCmd) Short(short string) (opt OptCmd) Long(long string) (opt OptCmd) Aliases(ss ...string) (opt OptCmd) Description(oneLine, long string) (opt OptCmd) Examples(examples string) (opt OptCmd) Group(group string) (opt OptCmd) Hidden(hidden bool) (opt OptCmd) Deprecated(deprecation string) (opt OptCmd) Action(action func(cmd *Command, args []string) (err error)) (opt OptCmd) // FlagAdd(flg *Flag) (opt OptCmd) // SubCommand(cmd *Command) (opt OptCmd) PreAction(pre func(cmd *Command, args []string) (err error)) (opt OptCmd) PostAction(post func(cmd *Command, args []string)) (opt OptCmd) TailPlaceholder(placeholder string) (opt OptCmd) NewFlag(typ OptFlagType) (opt OptFlag) NewSubCommand() (opt OptCmd) OwnerCommand() (opt OptCmd) SetOwner(opt OptCmd) RootCommand() *RootCommand }
OptCmd to support fluent api of cmdr. see also: cmdr.Root().NewSubCommand()/.NewFlag()
func NewCmdFrom ¶ added in v0.2.17
NewCmdFrom for fluent api
type OptFlag ¶ added in v0.2.15
type OptFlag interface { Titles(short, long string, aliases ...string) (opt OptFlag) Short(short string) (opt OptFlag) Long(long string) (opt OptFlag) Aliases(ss ...string) (opt OptFlag) Description(oneLine, long string) (opt OptFlag) Examples(examples string) (opt OptFlag) Group(group string) (opt OptFlag) Hidden(hidden bool) (opt OptFlag) Deprecated(deprecation string) (opt OptFlag) Action(action func(cmd *Command, args []string) (err error)) (opt OptFlag) ToggleGroup(group string) (opt OptFlag) DefaultValue(val interface{}, placeholder string) (opt OptFlag) ExternalTool(envKeyName string) (opt OptFlag) ValidArgs(list ...string) (opt OptFlag) // HeadLike enables `head -n` mode. // min, max will be ignored at this version, its might be impl in the future HeadLike(enable bool, min, max int64) (opt OptFlag) OwnerCommand() (opt OptCmd) SetOwner(opt OptCmd) RootCommand() *RootCommand }
OptFlag to support fluent api of cmdr. see also: cmdr.Root().NewSubCommand()/.NewFlag()
func NewStringSlice ¶ added in v0.2.17
func NewStringSlice() (opt OptFlag)
NewStringSlice for fluent api
type OptFlagType ¶ added in v0.2.15
type OptFlagType int
OptFlagType to support fluent api of cmdr. see also: OptCmd.NewFlag(OptFlagType) usage: ```golang root := cmdr.Root() co := root.NewSubCommand() co.NewFlag(cmdr.OptFlagTypeUint) ```
const ( // OptFlagTypeBool to create a new bool flag OptFlagTypeBool OptFlagType = iota // OptFlagTypeInt to create a new int flag OptFlagTypeInt OptFlagType = iota + 1 // OptFlagTypeUint to create a new uint flag OptFlagTypeUint OptFlagType = iota + 2 // OptFlagTypeInt64 to create a new int64 flag OptFlagTypeInt64 OptFlagType = iota + 3 // OptFlagTypeUint64 to create a new uint64 flag OptFlagTypeUint64 OptFlagType = iota + 4 // OptFlagTypeString to create a new string flag OptFlagTypeString OptFlagType = iota + 5 // OptFlagTypeStringSlice to create a new string slice flag OptFlagTypeStringSlice OptFlagType = iota + 6 // OptFlagTypeIntSlice to create a new int slice flag OptFlagTypeIntSlice OptFlagType = iota + 7 // OptFlagTypeFloat32 to create a new int slice flag OptFlagTypeFloat32 OptFlagType = iota + 8 // OptFlagTypeFloat64 to create a new int slice flag OptFlagTypeFloat64 OptFlagType = iota + 9 // OptFlagTypeDuration to create a new duration flag OptFlagTypeDuration OptFlagType = iota + 10 )
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
Options is a holder of all options
func NewOptionsWith ¶
NewOptionsWith returns an `Options` structure pointer
func (*Options) DumpAsString ¶
DumpAsString for debugging.
func (*Options) Get ¶
Get an `Option` by key string, eg: ```golang cmdr.Get("app.logger.level") => 'DEBUG',... ```
func (*Options) GetDuration ¶ added in v0.2.11
GetDuration returns the time duration value of an `Option` key.
func (*Options) GetFloat32 ¶ added in v1.0.1
GetFloat32 returns the float32 value of an `Option` key.
func (*Options) GetFloat64 ¶ added in v1.0.1
GetFloat64 returns the float64 value of an `Option` key.
func (*Options) GetHierarchyList ¶ added in v0.2.17
GetHierarchyList returns the hierarchy data for dumping
func (*Options) GetIntSlice ¶ added in v0.2.11
GetIntSlice returns the string slice value of an `Option` key.
func (*Options) GetMap ¶ added in v1.0.0
GetMap an `Option` by key string, it returns a hierarchy map or nil
func (*Options) GetStringSlice ¶
GetStringSlice returns the string slice value of an `Option` key.
func (*Options) LoadConfigFile ¶
LoadConfigFile Load a yaml config file and merge the settings into `rxxtOptions` and load files in the `conf.d` child directory too.
func (*Options) Reset ¶
func (s *Options) Reset()
Reset the exists `Options`, so that you could follow a `LoadConfigFile()` with it.
type Painter ¶ added in v0.2.9
type Painter interface { Printf(fmtStr string, args ...interface{}) FpPrintHeader(command *Command) FpPrintHelpTailLine(command *Command) FpUsagesTitle(command *Command, title string) FpUsagesLine(command *Command, fmt, appName, cmdList, cmdsTitle, tailPlaceHolder string) FpDescTitle(command *Command, title string) FpDescLine(command *Command) FpExamplesTitle(command *Command, title string) FpExamplesLine(command *Command) FpCommandsTitle(command *Command) FpCommandsGroupTitle(group string) FpCommandsLine(command *Command) FpFlagsTitle(command *Command, flag *Flag, title string) FpFlagsGroupTitle(group string) FpFlagsLine(command *Command, flag *Flag, defValStr string) Flush() Results() []byte // clear any internal states and reset itself Reset() }
Painter to support the genManual, genMarkdown, printHelpScreen.
type RootCmdOpt ¶ added in v0.2.15
type RootCmdOpt struct {
// contains filtered or unexported fields
}
RootCmdOpt for fluent api
func Root ¶ added in v0.2.15
func Root(appName, version string) (opt *RootCmdOpt)
Root for fluent api, create an new RootCommand
func (*RootCmdOpt) Copyright ¶ added in v0.2.15
func (s *RootCmdOpt) Copyright(copyright, author string) *RootCmdOpt
Copyright for fluent api
func (*RootCmdOpt) Deprecated ¶ added in v0.2.15
func (*RootCmdOpt) Description ¶ added in v0.2.15
func (*RootCmdOpt) Header ¶ added in v0.2.15
func (s *RootCmdOpt) Header(header string) *RootCmdOpt
Header for fluent api
func (*RootCmdOpt) NewFlag ¶ added in v0.2.15
func (s *RootCmdOpt) NewFlag(typ OptFlagType) (opt OptFlag)
func (*RootCmdOpt) NewSubCommand ¶ added in v0.2.15
func (s *RootCmdOpt) NewSubCommand() (opt OptCmd)
func (*RootCmdOpt) OwnerCommand ¶ added in v0.2.15
func (s *RootCmdOpt) OwnerCommand() (opt OptCmd)
func (*RootCmdOpt) PostAction ¶ added in v0.2.15
func (*RootCmdOpt) RootCommand ¶ added in v0.2.15
func (s *RootCmdOpt) RootCommand() (root *RootCommand)
func (*RootCmdOpt) StringSlice ¶ added in v0.2.15
func (s *RootCmdOpt) StringSlice() (opt OptFlag)
func (*RootCmdOpt) TailPlaceholder ¶ added in v0.2.15
type RootCommand ¶
type RootCommand struct { Command AppName string Version string VersionInt uint32 Copyright string Author string Header string // using `Header` for header and ignore built with `Copyright` and `Author`, and no usage lines too. // contains filtered or unexported fields }
RootCommand holds some application information
type StringOpt ¶ added in v0.2.15
type StringOpt struct {
// contains filtered or unexported fields
}
StringOpt for fluent api
func (*StringOpt) DefaultValue ¶ added in v0.2.15
func (*StringOpt) Deprecated ¶ added in v0.2.15
func (*StringOpt) Description ¶ added in v0.2.15
func (*StringOpt) ExternalTool ¶ added in v0.2.15
func (*StringOpt) OwnerCommand ¶ added in v0.2.15
func (s *StringOpt) OwnerCommand() (opt OptCmd)
func (*StringOpt) RootCommand ¶ added in v0.2.15
func (s *StringOpt) RootCommand() (root *RootCommand)
func (*StringOpt) ToggleGroup ¶ added in v0.2.15
type StringSliceOpt ¶ added in v0.2.15
type StringSliceOpt struct {
// contains filtered or unexported fields
}
StringSliceOpt for fluent api
func (*StringSliceOpt) DefaultValue ¶ added in v0.2.15
func (*StringSliceOpt) Deprecated ¶ added in v0.2.15
func (*StringSliceOpt) Description ¶ added in v0.2.15
func (*StringSliceOpt) ExternalTool ¶ added in v0.2.15
func (*StringSliceOpt) OwnerCommand ¶ added in v0.2.15
func (s *StringSliceOpt) OwnerCommand() (opt OptCmd)
func (*StringSliceOpt) RootCommand ¶ added in v0.2.15
func (s *StringSliceOpt) RootCommand() (root *RootCommand)
func (*StringSliceOpt) ToggleGroup ¶ added in v0.2.15
type SubCmdOpt ¶ added in v0.2.15
type SubCmdOpt struct {
// contains filtered or unexported fields
}
SubCmdOpt for fluent api
func (*SubCmdOpt) Deprecated ¶ added in v0.2.15
func (*SubCmdOpt) Description ¶ added in v0.2.15
func (*SubCmdOpt) NewFlag ¶ added in v0.2.15
func (s *SubCmdOpt) NewFlag(typ OptFlagType) (opt OptFlag)
func (*SubCmdOpt) NewSubCommand ¶ added in v0.2.15
func (s *SubCmdOpt) NewSubCommand() (opt OptCmd)
func (*SubCmdOpt) OwnerCommand ¶ added in v0.2.15
func (s *SubCmdOpt) OwnerCommand() (opt OptCmd)
func (*SubCmdOpt) PostAction ¶ added in v0.2.15
func (*SubCmdOpt) RootCommand ¶ added in v0.2.15
func (s *SubCmdOpt) RootCommand() (root *RootCommand)
func (*SubCmdOpt) StringSlice ¶ added in v0.2.15
func (s *SubCmdOpt) StringSlice() (opt OptFlag)
func (*SubCmdOpt) TailPlaceholder ¶ added in v0.2.15
type Uint64Opt ¶ added in v0.2.15
type Uint64Opt struct {
// contains filtered or unexported fields
}
Uint64Opt for fluent api
func (*Uint64Opt) DefaultValue ¶ added in v0.2.15
func (*Uint64Opt) Deprecated ¶ added in v0.2.15
func (*Uint64Opt) Description ¶ added in v0.2.15
func (*Uint64Opt) ExternalTool ¶ added in v0.2.15
func (*Uint64Opt) OwnerCommand ¶ added in v0.2.15
func (s *Uint64Opt) OwnerCommand() (opt OptCmd)
func (*Uint64Opt) RootCommand ¶ added in v0.2.15
func (s *Uint64Opt) RootCommand() (root *RootCommand)
func (*Uint64Opt) ToggleGroup ¶ added in v0.2.15
type UintOpt ¶ added in v0.2.15
type UintOpt struct {
// contains filtered or unexported fields
}
UintOpt for fluent api
func (*UintOpt) DefaultValue ¶ added in v0.2.15
func (*UintOpt) Deprecated ¶ added in v0.2.15
func (*UintOpt) Description ¶ added in v0.2.15
func (*UintOpt) ExternalTool ¶ added in v0.2.15
func (*UintOpt) OwnerCommand ¶ added in v0.2.15
func (s *UintOpt) OwnerCommand() (opt OptCmd)
func (*UintOpt) RootCommand ¶ added in v0.2.15
func (s *UintOpt) RootCommand() (root *RootCommand)
func (*UintOpt) ToggleGroup ¶ added in v0.2.15
Source Files ¶
- base_opt.go
- build_xref.go
- clone.go
- command.go
- def.go
- dir.go
- doc.go
- exec.go
- exec_match.go
- exec_unknown.go
- flag.go
- generate_cmds.go
- generate_shell.go
- opt.go
- opt_command_impl.go
- opt_flag_impl.go
- opt_ops.go
- options.go
- options.watch.go
- print.go
- print_colors.go
- print_painter.go
- print_painter_help.go
- print_painter_man.go
- print_painter_mkd.go
- print_tree.go
- tool.go
- walk.go
- whitespaces.go