Documentation ¶
Index ¶
- Constants
- type Action
- type ActionNative
- type ActionNativeDocopt
- type ActionNativeSimple
- type ActionNormal
- type ActionResult
- 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, 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, bool)
- func (d DocoptMap) GetStrings(key string) ([]string, bool)
- func (d DocoptMap) Map() map[string]interface{}
- func (d DocoptMap) MustBool(key string) bool
- func (d DocoptMap) MustFloat(key string) float32
- func (d DocoptMap) MustFloat64(key string) float64
- func (d DocoptMap) MustInt(key string) int
- func (d DocoptMap) MustInt64(key string) int64
- func (d DocoptMap) MustString(key string) string
- func (d DocoptMap) MustStrings(key string) []string
- type GoCommander
Constants ¶
View Source
const DEBUG bool = false
DEBUG open DEBUG mode
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 ¶
type ActionNative func()
The following are ACTION functions, chose one if you like it.
type ActionNativeDocopt ¶
The following are ACTION functions, chose one if you like it.
type ActionNativeSimple ¶
type ActionNativeSimple func() error
The following are ACTION functions, chose one if you like it.
type ActionNormal ¶
The following are ACTION functions, chose one if you like it.
type ActionResult ¶
type ActionResult func() _Result
The following are ACTION functions, chose one if you like it.
type ActionSimple ¶
type ActionSimple func(c Context)
The following are ACTION functions, chose one if you like it.
type Commander ¶
type Commander interface { Doc(doc string) Commander Version(ver string) Commander ShowVersion() string 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) ErrorHandling(func(error)) Commander }
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, bool) MustString(key string) string GetStrings(key string) ([]string, bool) MustStrings(key string) []string GetBool(key string) (bool, bool) MustBool(key string) bool GetInt64(key string) (int64, bool) MustInt64(key string) int64 GetInt(key string) (int, bool) MustInt(key string) int GetFloat64(key string) (float64, bool) MustFloat64(key string) float64 GetFloat(key string) (float32, bool) MustFloat(key string) float32 }
type DocoptMap ¶
type DocoptMap map[string]interface{}
DocoptMap docopt returns a map of option names to the values
func (DocoptMap) MustFloat64 ¶
func (DocoptMap) MustString ¶
func (DocoptMap) MustStrings ¶
type GoCommander ¶
var Program GoCommander = newProgram()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.