Documentation
¶
Index ¶
- func Args(ctx context.Context) []string
- func Flags(ctx context.Context) map[string]any
- type App
- type Arg
- type CLI
- func (c *CLI) App() *App
- func (c *CLI) Context() context.Context
- func (c *CLI) FindCommand(path ...string) (*Command, bool)
- func (c *CLI) Hook(phase HookPhase, h Hook)
- func (c *CLI) RegisterCommand(parentPath []string, cmd *Command) error
- func (c *CLI) Run(args []string) error
- func (c *CLI) Use(m Middleware)
- type Command
- type Handler
- type Hook
- type HookPhase
- type Middleware
- type Option
- type PluginRegistrar
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
func AppFromContext ¶
type CLI ¶
type CLI struct {
Root *Command
Middleware []Middleware
HelpCommandName string
// contains filtered or unexported fields
}
func (*CLI) RegisterCommand ¶
func (*CLI) Use ¶
func (c *CLI) Use(m Middleware)
type Command ¶
type Command struct {
Name string
Description string
Summary string
Hidden bool
Aliases []string
Args []Arg
Flags func(fs *flag.FlagSet)
Handler Handler
Commands []*Command
Before []Hook
After []Hook
Middleware []Middleware
}
func CurrentCommand ¶
type Middleware ¶
type Option ¶
type Option func(*CLI)
func WithAppData ¶
func WithHelpCommandName ¶
func WithLogger ¶
func WithWriters ¶
Click to show internal directories.
Click to hide internal directories.