cli

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EvalPrintUsage

func EvalPrintUsage(usage_func func() error, args []string, minlen int) bool

func FlushWriter

func FlushWriter(w *tabwriter.Writer)

func FormatDate

func FormatDate(date string) string

func NameValueSliceToMap

func NameValueSliceToMap(params []string) map[string]string

func NewTabWriter

func NewTabWriter(output io.Writer) *tabwriter.Writer

func Output

func Output(f Formatter, err error)

func Register

func Register(w *CLIWriter)

Types

type CLIWriter

type CLIWriter struct {
	FormatWriter func(f Formatter)
	ErrorWriter  func(err error)
}

Handles writing the formatted type into the desired output and global formatting

type FormatData added in v0.8.6

type FormatData struct {
	Data     interface{}
	Template string
	Funcs    template.FuncMap
}

func (FormatData) ToColumns added in v0.8.6

func (d FormatData) ToColumns(output io.Writer) error

type Formatter

type Formatter interface {
	ToColumns(output io.Writer) error
	Data() FormatData
}

Specializes in formatting a type into Column format

Jump to

Keyboard shortcuts

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