mirror of
https://github.com/hashicorp/packer.git
synced 2026-02-28 04:21:10 -05:00
* add basic docs for plugins command * refactor docs Co-Authored-By: Wilken Rivera <1749304+nywilken@users.noreply.github.com> * add plugins command * add plugins subcommands they do nothing for now * add plugins installed command + tests * add plugins install command * add remove plugin command * better docs for the plugins install command * remove duplicate content * better output for installed plugins * add plugins required command * Update plugins_install.go * add newline after `Usage:` * Update plugins_remove.go * Update plugins_required.go * Update plugins_remove.go * Update plugins_installed.go * Update plugins_install.go * add docs * Update plugins_install.go * fix typos * Update plugins_test.go * fix typos Co-Authored-By: Wilken Rivera <1749304+nywilken@users.noreply.github.com> * Update core_wrapper.go Co-Authored-By: Wilken Rivera <1749304+nywilken@users.noreply.github.com> * Update website/content/docs/commands/plugins/remove.mdx Co-authored-by: Wilken Rivera <wilken@hashicorp.com> * Update website/content/docs/commands/plugins/required.mdx Co-authored-by: Wilken Rivera <wilken@hashicorp.com> * Update website/content/docs/commands/plugins/required.mdx Co-authored-by: Wilken Rivera <wilken@hashicorp.com> * Update plugins_required.go * Update install.mdx * Update required.mdx * plugins requirement, warn when no plugin was found * Update website/content/docs/commands/plugins/required.mdx Co-authored-by: Wilken Rivera <wilken@hashicorp.com> Co-authored-by: Wilken Rivera <1749304+nywilken@users.noreply.github.com> Co-authored-by: Wilken Rivera <wilken@hashicorp.com>
108 lines
2.2 KiB
Go
108 lines
2.2 KiB
Go
package main
|
|
|
|
import (
|
|
"github.com/hashicorp/packer/command"
|
|
"github.com/mitchellh/cli"
|
|
)
|
|
|
|
// Commands is the mapping of all the available Packer commands.
|
|
var Commands map[string]cli.CommandFactory
|
|
|
|
// CommandMeta is the Meta to use for the commands. This must be written
|
|
// before the CLI is started.
|
|
var CommandMeta *command.Meta
|
|
|
|
const ErrorPrefix = "e:"
|
|
const OutputPrefix = "o:"
|
|
|
|
func init() {
|
|
Commands = map[string]cli.CommandFactory{
|
|
"build": func() (cli.Command, error) {
|
|
return &command.BuildCommand{Meta: *CommandMeta}, nil
|
|
},
|
|
"console": func() (cli.Command, error) {
|
|
return &command.ConsoleCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"fix": func() (cli.Command, error) {
|
|
return &command.FixCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"fmt": func() (cli.Command, error) {
|
|
return &command.FormatCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"hcl2_upgrade": func() (cli.Command, error) {
|
|
return &command.HCL2UpgradeCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"init": func() (cli.Command, error) {
|
|
return &command.InitCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"inspect": func() (cli.Command, error) {
|
|
return &command.InspectCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"plugin": func() (cli.Command, error) {
|
|
return &command.PluginCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"plugins": func() (cli.Command, error) {
|
|
return &command.PluginsCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"plugins installed": func() (cli.Command, error) {
|
|
return &command.PluginsInstalledCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"plugins install": func() (cli.Command, error) {
|
|
return &command.PluginsInstallCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"plugins remove": func() (cli.Command, error) {
|
|
return &command.PluginsRemoveCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"plugins required": func() (cli.Command, error) {
|
|
return &command.PluginsRequiredCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"validate": func() (cli.Command, error) {
|
|
return &command.ValidateCommand{
|
|
Meta: *CommandMeta,
|
|
}, nil
|
|
},
|
|
|
|
"version": func() (cli.Command, error) {
|
|
return &command.VersionCommand{
|
|
Meta: *CommandMeta,
|
|
CheckFunc: commandVersionCheck,
|
|
}, nil
|
|
},
|
|
}
|
|
}
|