Versions in this module Expand all Collapse all v0 v0.0.1 May 15, 2022 Changes in this version + func Main(a *App) + func SplitAtCommas(s string) []string + type App struct + func New(c *Config) (a *App) + func (a *App) AddCommand(cmd *Command) + func (a *App) Commands() *Commands + func (a *App) Config() *Config + func (a *App) GetCurrentCommand() string + func (a *App) GetPrompt() string + func (a *App) IsShell() bool + func (a *App) OnInit(f func(a *App, flags FlagMap) error) + func (a *App) OnShell(f func(a *App) error) + func (a *App) Print(args ...interface{}) (int, error) + func (a *App) PrintError(err error) + func (a *App) Printf(format string, args ...interface{}) (int, error) + func (a *App) Println(args ...interface{}) (int, error) + func (a *App) Run() (err error) + func (a *App) RunCommand(args []string) error + func (a *App) SetCurrentCommand(c string) + func (a *App) SetDefaultPrompt() + func (a *App) SetInterruptHandler(f func(a *App, count int)) + func (a *App) SetPrintASCIILogo(f func(a *App)) + func (a *App) SetPrintCommandHelp(f func(a *App, c *Command, shell bool)) + func (a *App) SetPrintHelp(f func(a *App, shell bool)) + func (a *App) SetPrompt(p string) + func (a *App) Stderr() io.Writer + func (a *App) Stdout() io.Writer + func (a *App) Write(p []byte) (int, error) + type ArgMap map[string]*ArgMapItem + func (a ArgMap) Bool(long string) bool + func (a ArgMap) BoolList(long string) []bool + func (a ArgMap) Duration(long string) time.Duration + func (a ArgMap) DurationList(long string) []time.Duration + func (a ArgMap) Float64(long string) float64 + func (a ArgMap) Float64List(long string) []float64 + func (a ArgMap) Int(long string) int + func (a ArgMap) Int64(long string) int64 + func (a ArgMap) Int64List(long string) []int64 + func (a ArgMap) IntList(long string) []int + func (a ArgMap) String(name string) string + func (a ArgMap) StringList(long string) []string + func (a ArgMap) Uint(long string) uint + func (a ArgMap) Uint64(long string) uint64 + func (a ArgMap) Uint64List(long string) []uint64 + func (a ArgMap) UintList(long string) []uint + type ArgMapItem struct + IsDefault bool + Value interface{} + type ArgOption func(*argItem) + func Default(v interface{}) ArgOption + func Max(m int) ArgOption + func Min(m int) ArgOption + type Args struct + func (a *Args) Bool(name, help string, opts ...ArgOption) + func (a *Args) BoolList(name, help string, opts ...ArgOption) + func (a *Args) Duration(name, help string, opts ...ArgOption) + func (a *Args) DurationList(name, help string, opts ...ArgOption) + func (a *Args) Float64(name, help string, opts ...ArgOption) + func (a *Args) Float64List(name, help string, opts ...ArgOption) + func (a *Args) Int(name, help string, opts ...ArgOption) + func (a *Args) Int64(name, help string, opts ...ArgOption) + func (a *Args) Int64List(name, help string, opts ...ArgOption) + func (a *Args) IntList(name, help string, opts ...ArgOption) + func (a *Args) String(name, help string, opts ...ArgOption) + func (a *Args) StringList(name, help string, opts ...ArgOption) + func (a *Args) Uint(name, help string, opts ...ArgOption) + func (a *Args) Uint64(name, help string, opts ...ArgOption) + func (a *Args) Uint64List(name, help string, opts ...ArgOption) + func (a *Args) UintList(name, help string, opts ...ArgOption) + type Command struct + Aliases []string + Args func(a *Args) + CMDPath string + Completer func(prefix string, args []string) []string + Flags func(f *Flags) + Help string + HelpGroup string + LongHelp string + Name string + Run func(c *Context) error + Usage string + func (c *Command) AddCommand(cmd *Command) + func (c *Command) Parent() *Command + func (c *Command) SetParam(param string, paramValue string) error + type Commands struct + func (c *Commands) Add(cmd *Command) + func (c *Commands) All() []*Command + func (c *Commands) FindCommand(args []string) (cmd *Command, rest []string, err error) + func (c *Commands) Get(name string) *Command + func (c *Commands) Remove(name string) (found bool) + func (c *Commands) RemoveAll() + func (c *Commands) Sort() + func (c *Commands) SortRecursive() + type Config struct + ASCIILogoColor *color.Color + CurrentCommand string + Description string + ErrorColor *color.Color + Flags func(f *Flags) + HelpHeadlineColor *color.Color + HelpHeadlineUnderline bool + HelpSubCommands bool + HistoryFile string + HistoryLimit int + MultiPrompt string + MultiPromptColor *color.Color + Name string + NoColor bool + Prompt string + PromptColor *color.Color + VimMode bool + func (c *Config) SetDefaults() + func (c *Config) Validate() error + type Context struct + App *App + Args ArgMap + Command *Command + Flags FlagMap + func (c *Context) Stop() + type FlagMap map[string]*FlagMapItem + func (f FlagMap) Bool(long string) bool + func (f FlagMap) Duration(long string) time.Duration + func (f FlagMap) Float64(long string) float64 + func (f FlagMap) Int(long string) int + func (f FlagMap) Int64(long string) int64 + func (f FlagMap) String(long string) string + func (f FlagMap) StringSlice(long string) []string + func (f FlagMap) Uint(long string) uint + func (f FlagMap) Uint64(long string) uint64 + type FlagMapItem struct + IsDefault bool + Value interface{} + type Flags struct + func (f *Flags) Bool(short, long string, defaultValue bool, help string) + func (f *Flags) BoolL(long string, defaultValue bool, help string) + func (f *Flags) Duration(short, long string, defaultValue time.Duration, help string) + func (f *Flags) DurationL(long string, defaultValue time.Duration, help string) + func (f *Flags) Float64(short, long string, defaultValue float64, help string) + func (f *Flags) Float64L(long string, defaultValue float64, help string) + func (f *Flags) Int(short, long string, defaultValue int, help string) + func (f *Flags) Int64(short, long string, defaultValue int64, help string) + func (f *Flags) Int64L(long string, defaultValue int64, help string) + func (f *Flags) IntL(long string, defaultValue int, help string) + func (f *Flags) String(short, long, defaultValue, help string) + func (f *Flags) StringL(long, defaultValue, help string) + func (f *Flags) StringList(short, long string, defaultValue []string, help string) + func (f *Flags) Uint(short, long string, defaultValue uint, help string) + func (f *Flags) Uint64(short, long string, defaultValue uint64, help string) + func (f *Flags) Uint64L(long string, defaultValue uint64, help string) + func (f *Flags) UintL(long string, defaultValue uint, help string)