stdcli

package
v0.0.0-...-a03e72d Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2015 License: Apache-2.0 Imports: 10 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 DirApp

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

If user specifies the app's name from command line, then use it; otherwise use the current working directory's name

func Error

func Error(err error)

func New

func New() *cli.App

func Query

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

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))

Types

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