clihelpers

package
v0.0.0-...-81cd3a7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatQuiet      format = "quiet"
	FormatTable      format = "table"
	FormatJSON       format = "json"
	FormatJSONPretty format = "json-pretty"

	FlagQuiet  = "quiet"
	FlagFormat = "format"

	None = "<none>"
)
View Source
const (
	WarningJQIsComplicated = "" /* 199-byte string literal not displayed */
)

Variables

View Source
var (
	BuildVersion        = ""
	BuildTime           = ""
	BuildGitHash        = ""
	NoPrintButFailError = errors.New("this error should never be printed")
)

Functions

func FailSilently

func FailSilently(cmd *cobra.Command) error

func PrintCollection

func PrintCollection(cmd *cobra.Command, collection OutputCollection)

func PrintErrors

func PrintErrors(cmd *cobra.Command, errs map[string]error)

func PrintRow

func PrintRow(cmd *cobra.Command, row OutputEntry)

func RegisterFormatFlags

func RegisterFormatFlags(flags *pflag.FlagSet)

Types

type OutputCollection

type OutputCollection interface {
	OutputHeader
	Table() [][]string
	Interface() interface{}
	Len() int
}

type OutputEntry

type OutputEntry interface {
	OutputHeader
	Fields() []string
	Interface() interface{}
}

type OutputHeader

type OutputHeader interface {
	Header() []string
}

Jump to

Keyboard shortcuts

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