Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrShowedHelp = errors.New("already showed help")
ErrShowedHelp is used in parsing argument function of subcommand when the subcommand showed help. Then caller can exit successfully and silently.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd interface { ProhibitRootExecution(args []string) bool Run(args []string) *Error FlagSet() *flag.FlagSet }
Cmd represents volt's subcommand interface. All subcommands must implement this.
type Error ¶
Error is a command error. It also has a exit code.
func DefaultRunner ¶
DefaultRunner simply runs command with args
func Run ¶
func Run(args []string, cont RunnerFunc) *Error
Run is invoked by main(), each argument means 'volt {subcmd} {args}'.
type RunnerFunc ¶
RunnerFunc invokes c with args. On unit testing, a mock function was given.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.