Documentation ¶
Index ¶
- Constants
- func CheckErr(err error)
- func DefaultSubCommandRun(out io.Writer) func(c *cobra.Command, args []string)
- func MultipleErrors(prefix string, errs []error) string
- func RequireNoArguments(c *cobra.Command, args []string)
- func StandardErrorMessage(err error) (msg string, ok bool)
- func UsageErrorf(cmd *cobra.Command, format string, args ...interface{}) error
- type Builder
- type DefaultPluginHandler
- type PluginHandler
Constants ¶
View Source
const DefaultErrorExitCode = 1
Variables ¶
This section is empty.
Functions ¶
func CheckErr ¶
func CheckErr(err error)
CheckErr prints a user friendly error to STDERR and exits with a non-zero exit code. Unrecognized errors will be printed with an "error: " prefix.
This method is generic to the command in use and may be used by non-Devctl commands.
func DefaultSubCommandRun ¶
DefaultSubCommandRun prints a command's help string to the specified output if no arguments (sub-commands) are provided, or a usage error otherwise.
func MultipleErrors ¶
MultipleErrors returns a newline delimited string containing the prefix and referenced errors in standard form.
func RequireNoArguments ¶
RequireNoArguments exits with a usage error if extra arguments are provided.
func StandardErrorMessage ¶
Types ¶
type DefaultPluginHandler ¶
DefaultPluginHandler implements PluginHandler
type PluginHandler ¶
type PluginHandler interface { Lookup(name string) (executablePath string, ok bool) Execute(executablePath string, cmdArgs, environment []string) (err error) }
func NewDefaultPluginHandler ¶
func NewDefaultPluginHandler() PluginHandler
Click to show internal directories.
Click to hide internal directories.