Documentation ¶
Index ¶
Constants ¶
View Source
const ( FormatText = "text" FormatInline = "inline" FormatJSON = "json" )
Variables ¶
View Source
var Flags = GlobalFlags{ Filter: "", Format: FormatText, Save: "", Host: "", HostNetworkKey: "", Network: config.EmulatorNetwork.Name, Log: logLevelInfo, Yes: false, ConfigPaths: config.DefaultPaths(), SkipVersionCheck: false, }
Flags initialized to default values.
View Source
var UsageTemplate = `` /* 1594-byte string literal not displayed */
Functions ¶
func ContainsFlag ¶ added in v0.21.0
ContainsFlag checks if output flag is present for the provided field.
Types ¶
type Command ¶
type Command struct { Cmd *cobra.Command Flags any Run run RunS RunWithState }
func (Command) AddToParent ¶
AddToParent add new command to main parent cmd and initializes all necessary things as well as take care of errors and output here we can do all boilerplate code that is else copied in each command and make sure we have one place to handle all errors and ensure commands have consistent results.
type GlobalFlags ¶
type GlobalFlags struct { Filter string Format string Save string Host string HostNetworkKey string Log string Network string Yes bool ConfigPaths []string SkipVersionCheck bool }
GlobalFlags contains all global flags definitions.
type Result ¶
type Result interface { // String will output the result in human readable output. String() string // Oneliner will output the result in "grep-able" format. Oneliner() string // JSON will output the result in JSON format JSON() any }
Result interface describes all the formats for the result output.
type ResultWithExitCode ¶ added in v1.15.0
Click to show internal directories.
Click to hide internal directories.