Test for the correct number of arguments to box add
This commit is contained in:
parent
4252fe94de
commit
9fce04c2cd
|
@ -1,6 +1,6 @@
|
||||||
## 0.9.3 (unreleased)
|
## 0.9.3 (unreleased)
|
||||||
|
|
||||||
|
- Proper error handling for not enough arguments to `box add`.
|
||||||
|
|
||||||
## 0.9.2 (January 20, 2012)
|
## 0.9.2 (January 20, 2012)
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ module Vagrant
|
||||||
# Parse the options
|
# Parse the options
|
||||||
argv = parse_options(opts)
|
argv = parse_options(opts)
|
||||||
return if !argv
|
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
|
# If we're force adding, then be sure to destroy any existing box if it
|
||||||
# exists.
|
# exists.
|
||||||
|
|
|
@ -128,6 +128,11 @@ module Vagrant
|
||||||
error_key(:failed, "vagrant.actions.box.verify")
|
error_key(:failed, "vagrant.actions.box.verify")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class CLIInvalidUsage < VagrantError
|
||||||
|
status_code(69)
|
||||||
|
error_key(:cli_invalid_usage)
|
||||||
|
end
|
||||||
|
|
||||||
class CLIInvalidOptions < VagrantError
|
class CLIInvalidOptions < VagrantError
|
||||||
status_code(1)
|
status_code(1)
|
||||||
error_key(:cli_invalid_options)
|
error_key(:cli_invalid_options)
|
||||||
|
|
|
@ -30,6 +30,11 @@ en:
|
||||||
An invalid option was specified. The help for this command
|
An invalid option was specified. The help for this command
|
||||||
is available below.
|
is available below.
|
||||||
|
|
||||||
|
%{help}
|
||||||
|
cli_invalid_usage: |-
|
||||||
|
This command was not invoked properly. The help for this command is
|
||||||
|
available below.
|
||||||
|
|
||||||
%{help}
|
%{help}
|
||||||
config_validation: |-
|
config_validation: |-
|
||||||
There was a problem with the configuration of Vagrant. The error message(s)
|
There was a problem with the configuration of Vagrant. The error message(s)
|
||||||
|
|
Loading…
Reference in New Issue