cliutils

package
v0.0.0-...-fc91ca8 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FormatTable      string = "table"
	FormatJSON       string = "json"
	FormatJSONStream string = "json-stream"
	FormatYAML       string = "yaml"
)

Variables

View Source
var CustomTemplate string

Functions

func AddFormatFlag

func AddFormatFlag(formatVar *string, categoryCmd *kingpin.CmdClause, allowedFormats ...string)

func DefaultTable

func DefaultTable() *tablewriter.Table

func DurafmtSince

func DurafmtSince(d time.Time) *durafmt.Durafmt

func GetSSHArgs

func GetSSHArgs(args []string) (preSSH []string, postSSH []string)

func GlobalAndCategorizedCmd

func GlobalAndCategorizedCmd(globalApp *kingpin.Application, categoryCmd *kingpin.CmdClause, do func(HasCommand))

func InitializeAPIClient

func InitializeAPIClient(config *global.Config) func(c *kingpin.ParseContext) error

func PrintWithFormat

func PrintWithFormat(obj interface{}, format string) error

func RequireAccessKey

func RequireAccessKey(config *global.Config, c interface{}) interface{}

func RequireProject

func RequireProject(config *global.Config, c interface{}) interface{}

func RequireVariableForPreAction

func RequireVariableForPreAction(config *global.Config, variable *string, err error, c interface{}) interface{}

Types

type HasCommand

type HasCommand interface {
	Command(name string, help string) *kingpin.CmdClause
}

Jump to

Keyboard shortcuts

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