sort versions and print them as listing

before this patch:

```
$ vagrant box remove --box-version 0.2.9 berendt/ubuntu-14.04-amd64
You requested to remove the box 'berendt/ubuntu-14.04-amd64' version '0.2.9' with
provider 'virtualbox', but that specific version of the box is
not install. Please double-check and try again. The available versions
for this box are:

0.2.11, 0.2.10
```

after this patch:

```
You requested to remove the box 'berendt/ubuntu-14.04-amd64' version '0.2.9' with
provider 'virtualbox', but that specific version of the box is
not install. Please double-check and try again. The available versions
for this box are:

 * 0.2.10
 * 0.2.11
```
This commit is contained in:
Christian Berendt 2014-04-11 11:39:38 +02:00
parent b97c509c15
commit 8dffbe5db8
1 changed files with 2 additions and 2 deletions

View File

@ -58,14 +58,14 @@ module Vagrant
raise Errors::BoxRemoveMultiVersion, raise Errors::BoxRemoveMultiVersion,
name: box_name, name: box_name,
provider: box_provider.to_s, provider: box_provider.to_s,
versions: all_versions.join(", ") versions: all_versions.sort.map! { |k| " * #{k}" }.join("\n")
end end
elsif !all_versions.include?(box_version) elsif !all_versions.include?(box_version)
raise Errors::BoxRemoveVersionNotFound, raise Errors::BoxRemoveVersionNotFound,
name: box_name, name: box_name,
provider: box_provider.to_s, provider: box_provider.to_s,
version: box_version, version: box_version,
versions: all_versions.join(", ") versions: all_versions.sort.map! { |k| " * #{k}" }.join("\n")
end end
box = env[:box_collection].find( box = env[:box_collection].find(