cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPromptCommandIsNotKnown = errors.New("prompt command is not known")
View Source
var FailureColor = color.New(color.FgRed, color.Bold)
View Source
var NeutralColor = color.New(color.FgCyan)
View Source
var NoColor = color.New()
View Source
var Output io.Writer = os.Stdout
View Source
var SuccessColor = color.New(color.FgGreen)
View Source
var WarnColor = color.New(color.FgYellow)

Functions

func Ask

func Ask(query string, args ...interface{}) (string, error)

func ColorPrint

func ColorPrint(col *color.Color, msg string)

func Error

func Error(msg string)

func Errorf

func Errorf(format string, args ...interface{})

func Fprint added in v0.2.0

func Fprint(w io.Writer, msg string)

func Info

func Info(msg string)

func Infof

func Infof(format string, args ...interface{})

func Print

func Print(msg string)

func Printf added in v0.2.0

func Printf(msg string, args ...interface{})

func Prompt

func Prompt(commands []PromptCmd) error

func Warn

func Warn(msg string)

func Warnf

func Warnf(format string, args ...interface{})

Types

type ColWriter added in v0.2.0

type ColWriter struct {
	PadLastColumn  bool
	SprintLineFunc func([]string, []int) string
	DecorateLine   func(string) string
	// contains filtered or unexported fields
}

func NewColWriter added in v0.2.0

func NewColWriter(w io.Writer, sep string) *ColWriter

func (*ColWriter) Flush added in v0.2.0

func (cw *ColWriter) Flush() error

func (*ColWriter) TotalWidth added in v0.2.0

func (cw *ColWriter) TotalWidth() int

func (*ColWriter) Write added in v0.2.0

func (cw *ColWriter) Write(buf []byte) (n int, err error)

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func PrefixedLogger

func PrefixedLogger(prefix string) *Logger

func (*Logger) ColorPrint

func (l *Logger) ColorPrint(col *color.Color, msg string)

func (*Logger) Error

func (l *Logger) Error(msg string)

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

func (*Logger) Fprint added in v0.2.0

func (l *Logger) Fprint(w io.Writer, msg string)

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

func (*Logger) Print

func (l *Logger) Print(msg string)

func (*Logger) Warn

func (l *Logger) Warn(msg string)

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...interface{})

type PromptCmd

type PromptCmd struct {
	TriggerInputs []string
	Description   string
	Action        func()
}

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table represents data as a table

func NewTable

func NewTable() *Table

NewTable creates a new table

func (*Table) Header

func (t *Table) Header(cells ...string) *Table

func (*Table) Render

func (t *Table) Render() string

Render renders the table

func (*Table) Row

func (t *Table) Row(cells ...string) *Table

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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