mirror of
https://github.com/hashicorp/packer.git
synced 2025-12-18 23:16:06 -05:00
commands: introduce plugin as alias to plugins
This commit is contained in:
parent
7f056211d9
commit
a463abd73b
2 changed files with 32 additions and 1 deletions
31
commands.go
31
commands.go
|
|
@ -107,5 +107,36 @@ func init() {
|
|||
CheckFunc: commandVersionCheck,
|
||||
}, nil
|
||||
},
|
||||
|
||||
// plugin is essentially an alias to the plugins command
|
||||
//
|
||||
// It is not meant to be documented or used outside of simple
|
||||
// typos, as it's easy to write plugin instead of plugins, so
|
||||
// we opted not to error, but silently alias the two writings.
|
||||
"plugin": func() (cli.Command, error) {
|
||||
return &command.PluginsCommand{
|
||||
Meta: *CommandMeta,
|
||||
}, nil
|
||||
},
|
||||
"plugin installed": func() (cli.Command, error) {
|
||||
return &command.PluginsInstalledCommand{
|
||||
Meta: *CommandMeta,
|
||||
}, nil
|
||||
},
|
||||
"plugin install": func() (cli.Command, error) {
|
||||
return &command.PluginsInstallCommand{
|
||||
Meta: *CommandMeta,
|
||||
}, nil
|
||||
},
|
||||
"plugin remove": func() (cli.Command, error) {
|
||||
return &command.PluginsRemoveCommand{
|
||||
Meta: *CommandMeta,
|
||||
}, nil
|
||||
},
|
||||
"plugin required": func() (cli.Command, error) {
|
||||
return &command.PluginsRequiredCommand{
|
||||
Meta: *CommandMeta,
|
||||
}, nil
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
main.go
2
main.go
|
|
@ -265,7 +265,7 @@ func wrappedMain() int {
|
|||
Args: args,
|
||||
Autocomplete: true,
|
||||
Commands: Commands,
|
||||
HelpFunc: excludeHelpFunc(Commands, []string{"execute"}),
|
||||
HelpFunc: excludeHelpFunc(Commands, []string{"execute", "plugin"}),
|
||||
HelpWriter: os.Stdout,
|
||||
Name: "packer",
|
||||
Version: version.Version,
|
||||
|
|
|
|||
Loading…
Reference in a new issue