console

package
v0.0.0-...-922f61c Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Optional = func(cmd *cobra.Command) {}
View Source
var Output io.Writer = os.Stdout
View Source
var Required = func(name string) func(cmd *cobra.Command) {
	return func(cmd *cobra.Command) { internal.MustNoErr(cmd.MarkFlagRequired(name)) }
}
View Source
var StyleProps []string
View Source
var Version string

Functions

func AddFileFlag

func AddFileFlag(cmd *cobra.Command, v *string, usage string, opts ...func(cmd *cobra.Command))

func AddOutputFlag

func AddOutputFlag(cmd *cobra.Command, v *string)

func AddOutputFlags

func AddOutputFlags(cmd *cobra.Command, cfg *OutCfg)

func EnableMarshalling

func EnableMarshalling(t reflect.Type)

func Fmt

func Fmt(a any)

func Fmtln

func Fmtln(a any)

func Msg

func Msg(str string) (int, error)

func NewJMESPathPrinter

func NewJMESPathPrinter(w gfmt.Writer, expr string) gfmt.Writer

func NewJQPrinter

func NewJQPrinter(w gfmt.Writer, expr string) gfmt.Writer

func NewTemplate

func NewTemplate(output io.Writer, p string) gfmt.Writer

func Parse

func Parse(r io.Reader) any

Parse attempts to detect the input format e.g., JSON and returns the value, which could be a key-value pairs (map) or a slice thereof.

func Reset

func Reset()

func RootHelpFunc

func RootHelpFunc(cmd *cobra.Command, _ []string)

func SetFormat

func SetFormat(opts map[string]any)

Types

type JMESPathWriter

type JMESPathWriter struct {
	Expr   *jmespath.JMESPath
	Indent string
	Color  bool
	// contains filtered or unexported fields
}

func (JMESPathWriter) Write

func (w JMESPathWriter) Write(i any) (n int, err error)

type JQWriter

type JQWriter struct {
	Expr   string
	Indent string
	Color  bool
	// contains filtered or unexported fields
}

func (JQWriter) Write

func (w JQWriter) Write(i interface{}) (int, error)

type OutCfg

type OutCfg struct {
	Output   string
	Query    string
	JQFilter string
}

type Printer

type Printer func(any) (int, error)

type Tmpl

type Tmpl struct {
	Formatter *formatter.CompFormatter
	// contains filtered or unexported fields
}

func (Tmpl) Write

func (w Tmpl) Write(a any) (int, error)

Jump to

Keyboard shortcuts

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