Documentation ¶
Overview ¶
Package cli provides utilities for building subcommand-based command line interfaces.
Index ¶
- func OpenInput(filename string) (string, io.ReadCloser, error)
- type Command
- func (c Command) CheckClose(statusp *subcommands.ExitStatus, cl io.Closer)
- func (c Command) Error(err error) subcommands.ExitStatus
- func (c Command) Fail(format string, args ...interface{}) subcommands.ExitStatus
- func (Command) SetFlags(f *flag.FlagSet)
- func (c Command) UsageError(format string, args ...interface{}) subcommands.ExitStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
Command is a base for all subcommands.
func NewBaseCommand ¶
NewBaseCommand builds a new base command for the named tool.
func (Command) CheckClose ¶
func (c Command) CheckClose(statusp *subcommands.ExitStatus, cl io.Closer)
CheckClose closes cl. On error it logs and writes to the status pointer. Intended for deferred Close() calls.
func (Command) Error ¶
func (c Command) Error(err error) subcommands.ExitStatus
Error logs err and returns a failing exit code.
func (Command) Fail ¶
func (c Command) Fail(format string, args ...interface{}) subcommands.ExitStatus
Fail logs an error message and returns a failing exit code.
func (Command) SetFlags ¶
SetFlags is a stub implementation of the SetFlags methods that does nothing.
func (Command) UsageError ¶
func (c Command) UsageError(format string, args ...interface{}) subcommands.ExitStatus
UsageError logs a usage error and returns a suitable exit code.
Click to show internal directories.
Click to hide internal directories.