Versions in this module Expand all Collapse all v0 v0.0.1 May 21, 2016 Changes in this version + const DefaultEditor + var ExitError = exitError + var GetEditor func() (string, error) + func Daemon(ctx *Context, successPrefix string) error + func DaemonResponse(resp string) + func HelpCommandFn(ctx *Context) error + func IsValidCommandName(commandName string) bool + func LaunchEditor(editor string) (content []byte, err error) + func Parse(args []string, argv interface{}) error + func RegisterFlagParser(name string, creator FlagParserCreator) + func Run(argv interface{}, fn CommandFunc, descs ...string) + func RunWithArgs(argv interface{}, args []string, fn CommandFunc, descs ...string) + func SetUsageStyle(style UsageStyle) + type Addr struct + Host string + Port uint16 + func (addr Addr) ToString() string + type AddrWithShort struct + Host string + Port uint16 + func (addr AddrWithShort) ToString() string + type ArgvFunc func() interface + type AutoHelper interface + AutoHelp func() bool + type Command struct + Aliases []string + Argv ArgvFunc + CanSubRoute bool + Desc string + Fn CommandFunc + HTTPMethods []string + HTTPRouters []string + Name string + NeedArgs bool + NoHTTP bool + NoHook bool + OnAfter func(*Context) error + OnBefore func(*Context) error + OnRootAfter func(*Context) error + OnRootBefore func(*Context) error + OnRootPrepareError func(error) error + Text string + func HelpCommand(desc string) *Command + func Root(root *Command, forest ...*CommandTree) *Command + func (cmd *Command) ChildrenDescriptions(prefix, indent string) string + func (cmd *Command) IsClient() bool + func (cmd *Command) IsServer() bool + func (cmd *Command) ListChildren() []string + func (cmd *Command) ListenAndServeHTTP(addr string) error + func (cmd *Command) Parent() *Command + func (cmd *Command) Path() string + func (cmd *Command) RPC(httpc *http.Client, ctx *Context) error + func (cmd *Command) Register(child *Command) *Command + func (cmd *Command) RegisterFunc(name string, fn CommandFunc, argvFn ArgvFunc) *Command + func (cmd *Command) RegisterHTTP(ctxs ...*Context) error + func (cmd *Command) RegisterTree(forest ...*CommandTree) + func (cmd *Command) Root() *Command + func (cmd *Command) Route(router []string) *Command + func (cmd *Command) Run(args []string) error + func (cmd *Command) RunWith(args []string, writer io.Writer, resp http.ResponseWriter, ...) error + func (cmd *Command) Serve(listeners ...net.Listener) (err error) + func (cmd *Command) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (cmd *Command) SetIsServer(yes bool) + func (cmd *Command) SubRoute(router []string) (*Command, int) + func (cmd *Command) Suggestions(path string) []string + func (cmd *Command) Usage(ctx *Context) string + type CommandFunc func(*Context) error + type CommandTree struct + func Tree(cmd *Command, forest ...*CommandTree) *CommandTree + type Context struct + HTTPRequest *http.Request + HTTPResponse http.ResponseWriter + func (ctx *Context) Args() []string + func (ctx *Context) Argv() interface{} + func (ctx *Context) Color() *color.Color + func (ctx *Context) Command() *Command + func (ctx *Context) FormValues() url.Values + func (ctx *Context) IsSet(flag string, aliasFlags ...string) bool + func (ctx *Context) JSON(obj interface{}) *Context + func (ctx *Context) JSONIndent(obj interface{}, prefix, indent string) *Context + func (ctx *Context) JSONIndentln(obj interface{}, prefix, indent string) *Context + func (ctx *Context) JSONln(obj interface{}) *Context + func (ctx *Context) NArg() int + func (ctx *Context) NativeArgs() []string + func (ctx *Context) Path() string + func (ctx *Context) Router() []string + func (ctx *Context) String(format string, args ...interface{}) *Context + func (ctx *Context) Usage() string + func (ctx *Context) Write(data []byte) (n int, err error) + func (ctx *Context) WriteUsage() + func (ctx *Context) Writer() io.Writer + type Decoder interface + Decode func(s string) error + type Encoder interface + Encode func() string + type FlagParser interface + Parse func(s string) error + type FlagParserCreator func(ptr interface{}) FlagParser + type Helper struct + Help bool + func (h Helper) AutoHelp() bool + type JSONFileParser struct + func (p JSONFileParser) Parse(s string) error + type JSONParser struct + func (p JSONParser) Parse(s string) error + type UsageStyle int32 + const ManualStyle + const NormalStyle + func GetUsageStyle() UsageStyle + type Validator interface + Validate func(*Context) error