Documentation
¶
Index ¶
- Variables
- 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 ErrFunc
- type GoCommander
- type Result
- type ResultCode
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
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 Action(action interface{}, keys ...[]string) Commander Command(usage string, args ...interface{}) Commander Option(usage string, args ...interface{}) Commander LineArgument(usage string, args ...interface{}) Commander LineOption(usage string, args ...interface{}) Commander UsagesString() []string OptionsString() []string HelpMessage() string ShowHelpMessage() string Parse(argv ...[]string) (Context, error) }
Commander Command line implementation
type Context ¶
type Context interface { // _ContextArguments GetArg(index 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()
type Result ¶
var ( ResultPass Result = &ResultCode{} ResultBreak = &ResultCode{_break: true} )
func NewResultCode ¶
func NewResultError ¶
type ResultCode ¶
type ResultCode struct {
// contains filtered or unexported fields
}
func (ResultCode) Break ¶
func (e ResultCode) Break() bool
func (ResultCode) Code ¶
func (e ResultCode) Code() int
func (ResultCode) Error ¶
func (e ResultCode) Error() error
func (ResultCode) ErrorString ¶
func (e ResultCode) ErrorString() string
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.