stdcli

package
v0.0.0-...-b659250 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Binary   string
	Commands []cli.Command
	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
	Writer   func(filename string, data []byte, perm os.FileMode) error
)

Functions

func Debug

func Debug() bool

func Default

func Default(value, def string) string

func DirApp

func DirApp(c *cli.Context, wd string) (string, string, error)

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 Duration

func Duration(start, end time.Time) string

func Error

func Error(err error)

func ExitError

func ExitError(err error) error

func New

func New() *cli.App

func ParseOpts

func ParseOpts(args []string) map[string]string

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 Query

func Query(bin string, args ...string) ([]byte, error)

func ReadSetting

func ReadSetting(setting string) string

func RegisterCommand

func RegisterCommand(cmd cli.Command)

func Run

func Run(bin string, args ...string) error

func Tag

func Tag() string

func Usage

func Usage(c *cli.Context, name string)

func VersionPrinter

func VersionPrinter(printer func(*cli.Context))

func WriteSetting

func WriteSetting(setting, value string) error

Types

type QOSEventProperties

type QOSEventProperties struct {
	Error error
	Start time.Time
}

type Table

type Table struct {
	Headers []string
	Rows    [][]string
}

func NewTable

func NewTable(headers ...string) *Table

func (*Table) AddRow

func (t *Table) AddRow(values ...string)

func (*Table) FormatString

func (t *Table) FormatString() string

func (*Table) Print

func (t *Table) Print()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL