Documentation ¶
Overview ¶
Package cli provides utilities for building subcommand-based command line interfaces.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OpenInput ¶
func OpenInput(filename string) (string, io.ReadCloser, error)
OpenInput is a convenience for possibly opening an input file, or otherwise returning standard in.
func OpenOutput ¶
func OpenOutput(filename string) (string, io.WriteCloser, error)
OpenOutput is a convenience for possibly opening an output file, or otherwise returning standard out.
Types ¶
type Command ¶
Command is a base for all subcommands.
func NewBaseCommand ¶
NewBaseCommand builds a new base command for the named tool.
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.