Documentation
¶
Index ¶
- type Action
- type ActionNative
- type ActionNativeDocopt
- type ActionNativeSimple
- type ActionNormal
- type ActionSimple
- type Commander
- type Context
- type DocoptMap
- func (d DocoptMap) Contain(key string) bool
- func (d DocoptMap) Get(key string) interface{}
- func (d DocoptMap) GetBool(key string) bool
- func (d DocoptMap) GetFloat(key string) (float32, bool)
- func (d DocoptMap) GetFloat64(key string) (float64, bool)
- func (d DocoptMap) GetInt(key string) (int, bool)
- func (d DocoptMap) GetInt64(key string) (int64, bool)
- func (d DocoptMap) GetString(key string) string
- func (d DocoptMap) GetStrings(key string) []string
- func (d DocoptMap) Map() map[string]interface{}
- func (d DocoptMap) String() string
- type GoCommander
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action func(c Context) _Result // default internal function
The following are ACTION functions, chose one if you like it.
type ActionNative ¶ added in v0.7.0
type ActionNative func()
The following are ACTION functions, chose one if you like it.
type ActionNativeDocopt ¶ added in v0.7.1
The following are ACTION functions, chose one if you like it.
type ActionNativeSimple ¶ added in v0.7.1
type ActionNativeSimple func() error
The following are ACTION functions, chose one if you like it.
type ActionNormal ¶ added in v0.7.0
The following are ACTION functions, chose one if you like it.
type ActionSimple ¶ added in v0.7.0
type ActionSimple func(c Context)
The following are ACTION functions, chose one if you like it.
type Commander ¶
type Commander interface {
Version(ver string) Commander
Description(desc string) Commander
Annotation(title string, contents []string) Commander
Command(usage string, args ...interface{}) Commander
Aliases(aliases []string) Commander
Option(usage string, args ...interface{}) Commander
Action(action interface{}, keys ...[]string) Commander
HelpMessage() string
ShowHelpMessage() string
Parse(argv ...[]string) (Context, error)
}
Commander Command line implementation
type Context ¶
type Context interface {
// _Argv
GetArg(index int) string
GetArgs(offsets ...int) []string
ArgsString() string
ArgsStringSeparator(sep string, offsets ...int) string
// DocoptMap
Map() map[string]interface{}
Get(key string) interface{}
Contain(key string) bool
GetString(key string) string
GetStrings(key string) []string
GetBool(key string) bool
GetInt64(key string) (int64, bool)
GetInt(key string) (int, bool)
GetFloat64(key string) (float64, bool)
GetFloat(key string) (float32, bool)
String() string
}
type DocoptMap ¶
type DocoptMap map[string]interface{}
DocoptMap docopt returns a map of option names to the values
func (DocoptMap) GetStrings ¶
type GoCommander ¶ added in v0.7.1
var Program GoCommander = newProgram()
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
calculator_example
command
|
|
|
counted_example
command
|
|
|
naval_fate
command
|
|
|
quick_example
command
|
Click to show internal directories.
Click to hide internal directories.