Documentation
¶
Index ¶
- func WithCompletion(c *cli) error
- type CLI
- type Option
- func WithCommandName(name string) Option
- func WithDefaultPlugins(projectVersion config.Version, plugins ...plugin.Plugin) Option
- func WithDefaultProjectVersion(version config.Version) Option
- func WithExtraCommands(cmds ...*cobra.Command) Option
- func WithPlugins(plugins ...plugin.Plugin) Option
- func WithVersion(version string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCompletion ¶
func WithCompletion(c *cli) error
WithCompletion is an Option that adds the completion subcommand.
Types ¶
type CLI ¶
type CLI interface {
// Run runs the CLI, usually returning an error if command line configuration
// is incorrect.
Run() error
}
CLI interacts with a command line interface.
type Option ¶
type Option func(*cli) error
Option is a function that can configure the cli
func WithCommandName ¶
WithCommandName is an Option that sets the cli's root command name.
func WithDefaultPlugins ¶
WithDefaultPlugins is an Option that sets the cli's default plugins.
func WithDefaultProjectVersion ¶
WithDefaultProjectVersion is an Option that sets the cli's default project version. Setting an unknown version will result in an error.
func WithExtraCommands ¶
WithExtraCommands is an Option that adds extra subcommands to the cli. Adding extra commands that duplicate existing commands results in an error.
func WithPlugins ¶
WithPlugins is an Option that sets the cli's plugins.
func WithVersion ¶
WithVersion is an Option that defines the version string of the cli.