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.
- commands/plugin: `vagrant plugin uninstall` can now uninstall multiple
plugins.
- commands/plugin: `vagrant plugin install` can now install multiple
plugins.
BUG FIXES:

View File

@ -13,7 +13,7 @@ module VagrantPlugins
options = { verbose: false }
opts = OptionParser.new do |o|
o.banner = "Usage: vagrant plugin install <name> [-h]"
o.banner = "Usage: vagrant plugin install <name>... [-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

View File

@ -20,7 +20,7 @@ of subcommands:
# 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
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