Documentation ¶
Index ¶
- Constants
- Variables
- func Add(app Application, parent *cobra.Command, builder ...CommandBuilder)
- func Confirm(message string) bool
- func ConfirmDeletion(kind string, item fmt.Stringer) bool
- func FormatAndIndent(text string, indent int) string
- func FormatExamples(examples string) string
- func FormatHelp(help string) string
- func Print(out console.Writer, val interface{}) error
- func PrintStdout(val interface{}) error
- func Run(app Application)
- func WaitForOrder(ctx context.Context, action string, ordering common.Ordering) (common.Order, error)
- type Application
- type CommandBuilder
- type ModuleFactory
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 ( Stdout = console.NewConsoleOutput(os.Stdout) Stderr = console.NewConsoleOutput(os.Stderr) )
View Source
var Config config
View Source
var Root = cobra.Command{}
Functions ¶
func Add ¶
func Add(app Application, parent *cobra.Command, builder ...CommandBuilder)
func FormatAndIndent ¶
func FormatExamples ¶
func FormatHelp ¶
func PrintStdout ¶
func PrintStdout(val interface{}) error
func Run ¶
func Run(app Application)
Types ¶
type Application ¶ added in v2.0.1
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 ¶ added in v2.0.1
type ModuleFactory func(app Application) *cobra.Command
Click to show internal directories.
Click to hide internal directories.