core: clarify output for boxadd error message

This commit is contained in:
Mitchell Hashimoto 2014-01-23 17:08:28 -08:00
parent 0fceed6ff4
commit acc57a3c18
3 changed files with 7 additions and 3 deletions

View File

@ -76,11 +76,13 @@ module Vagrant
if !provider if !provider
raise Errors::BoxAddNoMatchingVersion, raise Errors::BoxAddNoMatchingVersion,
constraints: version || ">= 0", constraints: version || ">= 0",
name: metadata.name,
url: url, url: url,
versions: metadata.versions.join(", ") versions: metadata.versions.join(", ")
else else
# TODO: show supported providers # TODO: show supported providers
raise Errors::BoxAddNoMatchingProvider, raise Errors::BoxAddNoMatchingProvider,
name: metadata.name,
requested: provider, requested: provider,
url: url url: url
end end

View File

@ -36,7 +36,7 @@ module VagrantPlugins
options[:provider] = p options[:provider] = p
end end
o.on("--version VALUE", String, "Constrain version of the added box") do |v| o.on("--box-version VALUE", String, "Constrain version of the added box") do |v|
options[:version] = v options[:version] = v
end end

View File

@ -221,14 +221,16 @@ en:
provider. Double-check your requested provider to verify you didn't provider. Double-check your requested provider to verify you didn't
simply misspell it. simply misspell it.
Box: %{url} Name: %{name}
Address: %{url}
Requested provider: %{requested} Requested provider: %{requested}
box_add_no_matching_version: |- box_add_no_matching_version: |-
The box you're attempting to add has no available version that The box you're attempting to add has no available version that
matches the constraints you requested. Please double-check your matches the constraints you requested. Please double-check your
settings. settings.
Box: %{url} Box: %{name}
Address: %{url}
Constraints: %{constraints} Constraints: %{constraints}
Available versions: %{versions} Available versions: %{versions}
boot_bad_state: |- boot_bad_state: |-