commands/plugin: vagrant plugin install can accept multiple

This commit is contained in:
Mitchell Hashimoto 2014-01-07 14:17:48 -08:00
parent 24a2892236
commit ea502c5c3d
3 changed files with 17 additions and 9 deletions

View File

@ -30,6 +30,8 @@ IMPROVEMENTS:
plugins, respecting any constraints set. plugins, respecting any constraints set.
- commands/plugin: `vagrant plugin uninstall` can now uninstall multiple - commands/plugin: `vagrant plugin uninstall` can now uninstall multiple
plugins. plugins.
- commands/plugin: `vagrant plugin install` can now install multiple
plugins.
BUG FIXES: BUG FIXES:

View File

@ -13,7 +13,7 @@ module VagrantPlugins
options = { verbose: false } options = { verbose: false }
opts = OptionParser.new do |o| opts = OptionParser.new do |o|
o.banner = "Usage: vagrant plugin install <name> [-h]" o.banner = "Usage: vagrant plugin install <name>... [-h]"
o.separator "" o.separator ""
build_install_opts(o, options) build_install_opts(o, options)
@ -28,13 +28,15 @@ module VagrantPlugins
raise Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1 raise Vagrant::Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1
# Install the gem # Install the gem
action(Action.action_install, { argv.each do |name|
:plugin_entry_point => options[:entry_point], action(Action.action_install, {
:plugin_version => options[:plugin_version], :plugin_entry_point => options[:entry_point],
:plugin_sources => options[:plugin_sources], :plugin_version => options[:plugin_version],
:plugin_name => argv[0], :plugin_sources => options[:plugin_sources],
:plugin_verbose => options[:verbose] :plugin_name => name,
}) :plugin_verbose => options[:verbose]
})
end
# Success, exit status 0 # Success, exit status 0
0 0

View File

@ -20,7 +20,7 @@ of subcommands:
# Plugin Install # Plugin Install
**Command: `vagrant plugin install <name>`** **Command: `vagrant plugin install <name>...`**
This installs a plugin with the given name or file path. If the name 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 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 also update a plugin if it is already installed, but you can also use
`vagrant plugin update` for that. `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: This command accepts optional command-line flags:
* `--entry-point ENTRYPOINT` - By default, installed plugins are loaded * `--entry-point ENTRYPOINT` - By default, installed plugins are loaded