From f2eff93c387a462b015f43467bc0d7a2e3ec6ec7 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 20 Jan 2012 15:23:33 -0800 Subject: [PATCH] Proper error handling of missing arguments to all box commands --- CHANGELOG.md | 2 +- lib/vagrant/command/box_remove.rb | 1 + lib/vagrant/command/box_repackage.rb | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6fa414bd..56f8213f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.9.3 (unreleased) - - Proper error handling for not enough arguments to `box add`. + - Proper error handling for not enough arguments to `box` commands. ## 0.9.2 (January 20, 2012) diff --git a/lib/vagrant/command/box_remove.rb b/lib/vagrant/command/box_remove.rb index dcba60c80..7d733e10c 100644 --- a/lib/vagrant/command/box_remove.rb +++ b/lib/vagrant/command/box_remove.rb @@ -13,6 +13,7 @@ module Vagrant # Parse the options argv = parse_options(opts) return if !argv + raise Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1 b = @env.boxes.find(argv[0]) raise Errors::BoxNotFound, :name => argv[0] if !b diff --git a/lib/vagrant/command/box_repackage.rb b/lib/vagrant/command/box_repackage.rb index f0d632b9b..a9f161cfc 100644 --- a/lib/vagrant/command/box_repackage.rb +++ b/lib/vagrant/command/box_repackage.rb @@ -13,6 +13,7 @@ module Vagrant # Parse the options argv = parse_options(opts) return if !argv + raise Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 1 b = @env.boxes.find(argv[0]) raise Errors::BoxNotFound, :name => argv[0] if !b