commands

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlagEndpoint = "endpoint"
	FlagToken    = "token"
	FlagDump     = "dump"
	FlagDryRun   = "dry-run"
	FlagFormat   = "format"
)
View Source
const (
	FormatJSON  = "json"
	FormatTable = "table"
	FormatCSV   = "csv"
)

Variables

View Source
var Config config
View Source
var Root = cobra.Command{}

Functions

func Add

func Add(app Application, parent *cobra.Command, builder ...CommandBuilder)

func Confirm

func Confirm(message string) bool

func ConfirmDeletion

func ConfirmDeletion(kind string, item fmt.Stringer) bool

func FormatAndIndent

func FormatAndIndent(text string, indent int) string

func FormatExamples

func FormatExamples(examples string) string

func FormatHelp

func FormatHelp(help string) string

func Print

func Print(out console.Writer, val interface{}) error

func PrintStdout

func PrintStdout(val interface{}) error

func Run

func Run(app Application)

func WaitForOrder

func WaitForOrder(ctx context.Context, action string, ordering common.Ordering) (common.Order, error)

Types

type Application

type Application struct {
	Name        string
	Description string
	Version     string
	Endpoint    string

	Modules []ModuleFactory
}

type CommandBuilder

type CommandBuilder interface {
	Build(app Application) *cobra.Command
}

type ModuleFactory

type ModuleFactory func(app Application) *cobra.Command

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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