diff --git a/lib/vagrant/command/base.rb b/lib/vagrant/command/base.rb index 26c11027a..4ffbd0155 100644 --- a/lib/vagrant/command/base.rb +++ b/lib/vagrant/command/base.rb @@ -48,8 +48,7 @@ module Vagrant opts.parse!(argv) return argv rescue OptionParser::InvalidOption - puts opts.help - return nil + raise Errors::CLIInvalidOptions, :help => opts.help.chomp end # Yields a VM for each target VM for the command. diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 912a7118a..5e7c1f82c 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -128,9 +128,9 @@ module Vagrant error_key(:failed, "vagrant.actions.box.verify") end - class CLIMissingEnvironment < VagrantError + class CLIInvalidOptions < VagrantError status_code(1) - error_key(:cli_missing_env) + error_key(:cli_invalid_options) end class ConfigValidationFailed < VagrantError diff --git a/templates/locales/en.yml b/templates/locales/en.yml index d0e505d8d..93d0d0675 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -26,6 +26,11 @@ en: puppetd_not_detected: |- The `puppetd` binary was not found on the VM is required for Puppet Server provisioning. Please verify that Puppet is installed and that the binary is available on the PATH. + cli_invalid_options: |- + An invalid option was specified. The help for this command + is available below. + + %{help} config_validation: |- There was a problem with the configuration of Vagrant. The error message(s) are printed below: