diff --git a/CHANGELOG.md b/CHANGELOG.md index 96454eba7..ebaf111ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ IMPROVEMENTS: plugins, respecting any constraints set. - commands/plugin: `vagrant plugin uninstall` can now uninstall multiple plugins. + - commands/plugin: `vagrant plugin install` can now install multiple + plugins. BUG FIXES: diff --git a/plugins/commands/plugin/command/install.rb b/plugins/commands/plugin/command/install.rb index b38a08e25..3c872baf4 100644 --- a/plugins/commands/plugin/command/install.rb +++ b/plugins/commands/plugin/command/install.rb @@ -13,7 +13,7 @@ module VagrantPlugins options = { verbose: false } opts = OptionParser.new do |o| - o.banner = "Usage: vagrant plugin install [-h]" + o.banner = "Usage: vagrant plugin install ... [-h]" o.separator "" build_install_opts(o, options) @@ -28,13 +28,15 @@ module VagrantPlugins raise Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1 # Install the gem - action(Action.action_install, { - :plugin_entry_point => options[:entry_point], - :plugin_version => options[:plugin_version], - :plugin_sources => options[:plugin_sources], - :plugin_name => argv[0], - :plugin_verbose => options[:verbose] - }) + argv.each do |name| + action(Action.action_install, { + :plugin_entry_point => options[:entry_point], + :plugin_version => options[:plugin_version], + :plugin_sources => options[:plugin_sources], + :plugin_name => name, + :plugin_verbose => options[:verbose] + }) + end # Success, exit status 0 0 diff --git a/website/docs/source/v2/cli/plugin.html.md b/website/docs/source/v2/cli/plugin.html.md index 35504bad8..9ff754059 100644 --- a/website/docs/source/v2/cli/plugin.html.md +++ b/website/docs/source/v2/cli/plugin.html.md @@ -20,7 +20,7 @@ of subcommands: # Plugin Install -**Command: `vagrant plugin install `** +**Command: `vagrant plugin install ...`** This installs a plugin with the given name or file path. If the name is not a path to a file, then the plugin is installed from remote @@ -28,6 +28,10 @@ repositories, usually [RubyGems](http://rubygems.org). This command will also update a plugin if it is already installed, but you can also use `vagrant plugin update` for that. +If multiple names are specified, multiple plugins will be installed. If +flags are given below, the flags will apply to _all_ plugins being installed +by the current command invocation. + This command accepts optional command-line flags: * `--entry-point ENTRYPOINT` - By default, installed plugins are loaded