Documentation
¶
Index ¶
- Variables
- func CheckEnv() error
- func CliCheckEnv(c *cli.Context) error
- func Debug() bool
- func Default(value, def string) string
- func DirApp(c *cli.Context, wd string) (string, string, error)
- func Duration(start, end time.Time) string
- func EnsureOnlyFlags(c *cli.Context, args []string)
- func Error(err error) error
- func Errorf(format string, args ...interface{}) error
- func FlagsToOptions(c *cli.Context, args []string) map[string]string
- func IsTerminal(f *os.File) bool
- func NeedArg(c *cli.Context, count int)
- func NeedHelp(c *cli.Context)
- func New() *cli.App
- func OK() (int, error)
- func ParseOpts(args []string) map[string]string
- func QOSEventSend(system, id string, ep QOSEventProperties) error
- func Query(bin string, args ...string) ([]byte, error)
- func ReadSetting(setting string) string
- func RecoverFlag(c *cli.Context, flagNames ...string) string
- func RegisterCommand(cmd cli.Command)
- func Run(bin string, args ...string) error
- func Sprintf(format string, args ...interface{}) string
- func Startf(format string, args ...interface{}) (int, error)
- func Tag() string
- func Usage(c *cli.Context)
- func ValidatePreconditions(preconditions ...cli.BeforeFunc) cli.BeforeFunc
- func VersionPrinter(printer func(*cli.Context))
- func Wait(status string) (int, error)
- func Warn(msg string) (int, error)
- func Write(data []byte) (int, error)
- func WriteSetting(setting, value string) error
- func Writef(format string, args ...interface{}) (int, error)
- type ErrorStdCli
- type Info
- type InfoRow
- type QOSEventProperties
- type Renderer
- type Table
- type Writer
- func (w *Writer) Error(err error) error
- func (w *Writer) Errorf(format string, args ...interface{}) error
- func (w *Writer) OK() (int, error)
- func (w *Writer) Sprintf(format string, args ...interface{}) string
- func (w *Writer) Startf(format string, args ...interface{}) (int, error)
- func (w *Writer) Wait(status string) (int, error)
- func (w *Writer) Warn(status string) (int, error)
- func (w *Writer) Write(data []byte) (int, error)
- func (w *Writer) Writef(format string, args ...interface{}) (int, error)
Constants ¶
This section is empty.
Variables ¶
var ( Binary string Commands []cli.Command FileWriter func(filename string, data []byte, perm os.FileMode) error Exiter func(code int) Runner func(bin string, args ...string) error Querier func(bin string, args ...string) ([]byte, error) Spinner *spinner.Spinner Tagger func() string HelpFlags []string )
Functions ¶
func CheckEnv ¶
func CheckEnv() error
CheckEnv validates that relevant envvars have acceptable values
func CliCheckEnv ¶
CliCheckEnv takes cli.Context as an arg so it can be used as a BeforeFunc
func DirApp ¶
If user specifies the app's name from command line, then use it; if not, try to read the app name from .convox/app otherwise use the current working directory's name
func EnsureOnlyFlags ¶
EnsureOnlyFlags ensures that every element in the args slice starts with --
func FlagsToOptions ¶
FlagsToOptions converts a list of '--key=value'/'--bool' strings to 'key: value, bool: true'-style map
func IsTerminal ¶
IsTerminal tells you if a given file descriptor has a tty on the other side
func QOSEventSend ¶
func QOSEventSend(system, id string, ep QOSEventProperties) error
QOSEventSend sends an internal CLI event to segment for quality-of-service purposes. If the event is an error it also sends the error to rollbar, then displays the error to the user and exits non-zero.
func ReadSetting ¶
func RecoverFlag ¶
RecoverFlag allows us to capture things like --app FOO which would otherwise be discarded by urfave/cli if passed in position 0
func RegisterCommand ¶
func ValidatePreconditions ¶
func ValidatePreconditions(preconditions ...cli.BeforeFunc) cli.BeforeFunc
ValidatePreconditions runs one or more cli.BeforeFuncs where called in Command.Before