Test for the correct number of arguments to box add

This commit is contained in:
Mitchell Hashimoto 2012-01-20 15:21:54 -08:00
parent 4252fe94de
commit 9fce04c2cd
4 changed files with 12 additions and 1 deletions

View File

@ -1,6 +1,6 @@
## 0.9.3 (unreleased)
- Proper error handling for not enough arguments to `box add`.
## 0.9.2 (January 20, 2012)

View File

@ -18,6 +18,7 @@ module Vagrant
# Parse the options
argv = parse_options(opts)
return if !argv
raise Errors::CLIInvalidUsage, :help => opts.help.chomp if argv.length < 2
# If we're force adding, then be sure to destroy any existing box if it
# exists.

View File

@ -128,6 +128,11 @@ module Vagrant
error_key(:failed, "vagrant.actions.box.verify")
end
class CLIInvalidUsage < VagrantError
status_code(69)
error_key(:cli_invalid_usage)
end
class CLIInvalidOptions < VagrantError
status_code(1)
error_key(:cli_invalid_options)

View File

@ -30,6 +30,11 @@ en:
An invalid option was specified. The help for this command
is available below.
%{help}
cli_invalid_usage: |-
This command was not invoked properly. The help for this command is
available below.
%{help}
config_validation: |-
There was a problem with the configuration of Vagrant. The error message(s)