Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoRootCommand = errors.New("no root command provided")
ErrNoRootCommand is returned when no root command is provided.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
CobraProvider
Exit func(code int)
// contains filtered or unexported fields
}
App represents a command line application.
func (*App) Execute ¶
Execute will execute the application with the provided options and return error if any.
func (*App) ExecuteOrDie ¶
ExecuteOrDie will execute the application or perform os.Exit in case of error.
type CobraProvider ¶
CobraProvider is used to provide a Cobra command.
type Option ¶
type Option func(*App)
Option is used to configure an App.
func WithCommand ¶ added in v1.1.0
WithCommand will allow one to change the cobra.Command.
func WithInput ¶
WithInput creates an option witch sets os.Stdin. Deprecated: use WithCommand instead.
func WithOutput ¶
WithOutput creates an option witch sets os.Stdout and os.Stderr. Deprecated: use WithCommand instead.
Click to show internal directories.
Click to hide internal directories.