From 8dffbe5db8e3154aeef8bd5566562d02ba0a35da Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Fri, 11 Apr 2014 11:39:38 +0200 Subject: [PATCH] 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 ``` --- lib/vagrant/action/builtin/box_remove.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/action/builtin/box_remove.rb b/lib/vagrant/action/builtin/box_remove.rb index a62478a4e..d89351daa 100644 --- a/lib/vagrant/action/builtin/box_remove.rb +++ b/lib/vagrant/action/builtin/box_remove.rb @@ -58,14 +58,14 @@ module Vagrant raise Errors::BoxRemoveMultiVersion, name: box_name, provider: box_provider.to_s, - versions: all_versions.join(", ") + versions: all_versions.sort.map! { |k| " * #{k}" }.join("\n") end elsif !all_versions.include?(box_version) raise Errors::BoxRemoveVersionNotFound, name: box_name, provider: box_provider.to_s, version: box_version, - versions: all_versions.join(", ") + versions: all_versions.sort.map! { |k| " * #{k}" }.join("\n") end box = env[:box_collection].find(