Versions in this module Expand all Collapse all v0 v0.7.4-ap Feb 14, 2020 v0.6.2 Feb 14, 2020 Changes in this version + const DefaultUsage + const ExitFailure + const ExitInternal + const ExitSuccess + const ExitUsage + var FlagDoubleDash = false + func CommandPath(ctx Context) (out []string) + func ErrWithCode(code int, err error) error + func Fatal(err error) + func FormatError(err error) (msg string, code int) + func HelpRequest() error + func IsUsageError(err error) bool + func ProgName() string + func ReaderIsPipe(in io.Reader) bool + func Reset() + func Run(ctx context.Context, args []string, b Builder) (rerr error) + func UsageError(err error) error + func UsageErrorf(msg string, args ...interface{}) error + func WriterIsPipe(out io.Writer) bool + type BufferedRunner struct + StderrBuffer bytes.Buffer + StdinBuffer bytes.Buffer + StdoutBuffer bytes.Buffer + func NewBufferedRunner() *BufferedRunner + type Builder func() Command + type Builders map[string]Builder + type Command interface + Configure func(flags *FlagSet, args *arg.ArgSet) + Run func(Context) error + Synopsis func() string + type CommandArgs interface + Args func() *arg.ArgSet + type CommandFlags interface + Flags func() *FlagSet + type CommandRef struct + Command Command + Name string + type Context interface + Current func() CommandRef + Pop func() (name string, cmd Command) + Push func(name string, cmd Command) + RawArgs func() []string + Runner func() *Runner + Stack func() []CommandRef + Stderr func() io.Writer + Stdin func() io.Reader + Stdout func() io.Writer + type Error interface + Code func() int + type FlagSet struct + WrapWidth int + func FlagSetFromStd(fs *flag.FlagSet) *FlagSet + func NewFlagSet() *FlagSet + func (fs *FlagSet) HideUsage() + func (fs *FlagSet) Invocation() string + func (fs *FlagSet) Usage() string + type Group struct + After func(Context, error) error + Before func(Context) error + Builders Builders + FlagBuilder func() *FlagSet + Matcher Matcher + Rewriter GroupRewriter + func NewGroup(synopsis string, builders Builders, opts ...GroupOption) *Group + func (cs *Group) Builder(cmd string) (bld Builder, name string, rerr error) + func (cs *Group) Configure(flags *FlagSet, args *arg.ArgSet) + func (cs *Group) Flags() *FlagSet + func (cs *Group) Run(ctx Context) error + func (cs *Group) Synopsis() string + func (cs *Group) Usage() string + type GroupOption func(cs *Group) + func GroupAfter(fn func(Context, error) error) GroupOption + func GroupBefore(before func(Context) error) GroupOption + func GroupFlags(fb func() *FlagSet) GroupOption + func GroupHide(names ...string) GroupOption + func GroupMatcher(cm Matcher) GroupOption + func GroupPrefixMatcher(minLen int) GroupOption + func GroupRewrite(rw GroupRewriter) GroupOption + func GroupUsage(usage string) GroupOption + type GroupRewriter func(group *Group, args GroupRunState) (out *GroupRunState) + type GroupRunState struct + Builder Builder + Name string + Subcommand string + SubcommandArgs []string + type Matcher func(bldrs Builders, in string) (bld Builder, name string, rerr error) + func PrefixMatcher(group *Group, minLen int) Matcher + type QuietExit int + func (e QuietExit) Code() int + func (e QuietExit) Error() string + type Runner struct + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + func DefaultRunner() *Runner + func NewStandardRunner() *Runner + func (r *Runner) Fatal(err error) + func (r *Runner) Run(ctx context.Context, name string, args []string, b Builder) (rerr error) + type Usage interface + Usage func() string + type UsageCommand interface