Documentation ¶
Overview ¶
TODO:
> Split up in separate files > command.go > application.go > descriptor.go > Document symbols > Write unit tests
Final notes:
This package DOES NOT hold a stable public API and is meant for internal purposes only.
Index ¶
- func ExtractCommandArgs(input []string) (cmd string, args []string)
- type Application
- func (d *Application) Description() string
- func (d *Application) Name() string
- func (app Application) ReadLn() string
- func (app Application) Register(cmd Command)
- func (app Application) Run(command string, args []string) int
- func (d *Application) SetDescription(description string)
- func (d *Application) SetName(name string)
- func (app Application) Usage()
- func (app Application) Write(message string)
- func (app Application) WriteError(message string)
- func (app Application) WriteErrorLn(message string)
- func (app Application) WriteLn(message string)
- type BaseCommand
- type Command
- type Commands
- type Describable
- type Describers
- type IO
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
func NewApplication ¶
func (Application) ReadLn ¶
func (app Application) ReadLn() string
func (Application) Register ¶
func (app Application) Register(cmd Command)
func (Application) Run ¶
func (app Application) Run(command string, args []string) int
func (Application) Usage ¶
func (app Application) Usage()
func (Application) Write ¶
func (app Application) Write(message string)
func (Application) WriteError ¶
func (app Application) WriteError(message string)
func (Application) WriteErrorLn ¶
func (app Application) WriteErrorLn(message string)
func (Application) WriteLn ¶
func (app Application) WriteLn(message string)
type BaseCommand ¶
type BaseCommand struct { Command // contains filtered or unexported fields }
func (BaseCommand) Description ¶
func (cmd BaseCommand) Description() string
func (BaseCommand) Init ¶
func (cmd BaseCommand) Init(args []string) ([]string, error)
func (BaseCommand) Name ¶
func (cmd BaseCommand) Name() string
type Command ¶
type Describers ¶
type Describers []Describable
func (Describers) Len ¶
func (d Describers) Len() int
func (Describers) Less ¶
func (d Describers) Less(i, j int) bool
func (Describers) Swap ¶
func (d Describers) Swap(i, j int)
type IO ¶
Click to show internal directories.
Click to hide internal directories.