Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WithLogger = fopt.Setter(func(c *Command) *slog.Logger { return c.Logger }) WithFlagSet = fopt.Setter(func(c *Command) *flag.FlagSet { return c.FlagSet }) WithBefore = fopt.Setter(func(c *Command) *HandlerFunc { return &c.Before }) WithRun = fopt.Setter(func(c *Command) *HandlerFunc { return &c.Run }) WithAfter = fopt.Setter(func(c *Command) *HandlerFunc { return &c.After }) WithMatch = fopt.Setter(func(c *Command) *func(string) bool { return &c.Match }) )
View Source
var DefaultRoot = NewRoot("", "", flag.ExitOnError)
Functions ¶
func ParseAndRunFromCLI ¶
func ParseAndRunFromCLI() error
Types ¶
type Command ¶
type Command struct {
Name string
Summary string
Before HandlerFunc
Run HandlerFunc
After HandlerFunc
Match func(string) bool
SubCommands []*Command
Parent *Command
*flag.FlagSet
*slog.Logger
}
func (*Command) ParseAndRun ¶
type HandlerFunc ¶
Click to show internal directories.
Click to hide internal directories.