Documentation ¶
Index ¶
- Constants
- func AddActionUsage(parts []string, table *Table, action *Action)
- func Black(s string) string
- func Blue(s string) string
- func Colorize(c int, s string) (r string)
- func Cyan(s string) string
- func Green(s string) string
- func Magenta(s string) string
- func Red(s string) string
- func White(s string) string
- func Yellow(s string) string
- type Action
- type Args
- func (a *Args) AddAttribute(k, v string)
- func (a *Args) AddFlag(key, value string)
- func (a *Args) AttributesMap() map[string]string
- func (a *Args) Bool(key string)
- func (a *Args) BuildStringFlag(key string, required bool, defaultValue, description string) *Flag
- func (a *Args) Get(key string) []string
- func (a *Args) GetBool(key string) bool
- func (a *Args) GetInt(key string) (int, error)
- func (a *Args) GetString(key string) (string, error)
- func (a *Args) KeyForCliKey(cliKey string) string
- func (a *Args) Length() int
- func (a *Args) MustGetInt(key string) int
- func (a *Args) MustGetString(key string) string
- func (a *Args) Parse(args []string) error
- func (a *Args) RegisterArgs(args string)
- func (a *Args) RegisterBool(cliKey string, key string, required bool, defaultValue bool, ...)
- func (a *Args) RegisterFlag(flag *Flag)
- func (a *Args) RegisterInt(cliKey string, key string, required bool, defaultValue int, description string)
- func (a *Args) RegisterString(cliKey string, key string, required bool, defaultValue, description string)
- func (a *Args) String(key string)
- func (a *Args) TypeOf(key string) (out string, e error)
- func (a *Args) Usage() string
- type Argument
- type ArgumentMap
- type Flag
- type FlagMap
- type Router
- func (cli *Router) Handle(raw []string) error
- func (router *Router) Println(a ...interface{})
- func (cli *Router) Register(path string, action *Action)
- func (router *Router) Search(patterns []string) map[string]*Action
- func (cli *Router) Usage() string
- func (cli *Router) UsageForKeys(keys []string, pattern string) string
- type Table
- func (t *Table) Add(cols ...interface{})
- func (t *Table) AddP(cols ...interface{})
- func (t *Table) AddStrings(list []string)
- func (t *Table) Header(cols ...interface{})
- func (t *Table) Len() int
- func (t *Table) Less(a, b int) bool
- func (t *Table) Lines(printIndex bool) (lines []string)
- func (t *Table) Select(message string) int
- func (t *Table) String() string
- func (t *Table) StringWithIndex() string
- func (t *Table) Swap(a, b int)
Constants ¶
View Source
const ( STRING = "string" INTEGER = "int" BOOL = "bool" )
View Source
const ( BLACK = iota RED GREEN YELLOW BLUE MAGENTA CYAN WHITE )
Variables ¶
This section is empty.
Functions ¶
func AddActionUsage ¶
Types ¶
type Args ¶
type Args struct { Args []string Attributes map[string][]string FlagMap FlagMap ArgumentMap ArgumentMap Flags []*Flag // contains filtered or unexported fields }
func (*Args) AddAttribute ¶
func (*Args) AttributesMap ¶
func (*Args) BuildStringFlag ¶
func (*Args) KeyForCliKey ¶
func (*Args) MustGetInt ¶
func (*Args) MustGetString ¶
func (*Args) RegisterArgs ¶
func (*Args) RegisterBool ¶
func (*Args) RegisterFlag ¶
func (*Args) RegisterInt ¶
func (*Args) RegisterString ¶
type ArgumentMap ¶
type Flag ¶
type Table ¶
type Table struct { Columns [][]string Separator string SortBy int // contains filtered or unexported fields }
func (*Table) AddP ¶
func (t *Table) AddP(cols ...interface{})
Dereferencing pointers if not nil TODO: Please someone tell me, how to do this right!
func (*Table) AddStrings ¶
func (*Table) StringWithIndex ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.