Add machine readable output for `vagrant plugin list` command

This commit is contained in:
Emiliano Ticci 2014-03-23 13:09:16 +01:00
parent f7adeadf8d
commit 08e7a76962
1 changed files with 4 additions and 0 deletions

View File

@ -33,17 +33,21 @@ module VagrantPlugins
system = ""
system = ", system" if plugin && plugin["system"]
env[:ui].info "#{spec.name} (#{spec.version}#{system})"
env[:ui].machine("plugin-name", spec.name)
env[:ui].machine("plugin-version", "#{spec.version}#{system}")
if plugin["gem_version"] && plugin["gem_version"] != ""
env[:ui].info(I18n.t(
"vagrant.commands.plugin.plugin_version",
version: plugin["gem_version"]))
env[:ui].machine("plugin-version-constraint", plugin["gem_version"])
end
if plugin["require"] && plugin["require"] != ""
env[:ui].info(I18n.t(
"vagrant.commands.plugin.plugin_require",
require: plugin["require"]))
env[:ui].machine("plugin-custom-entrypoint", plugin["require"])
end
end