core: vagrant -v no longer loads Vagrantfile

This commit is contained in:
Mitchell Hashimoto 2013-09-02 15:43:59 -07:00
parent d9d9264747
commit 896ae7b9ba
3 changed files with 8 additions and 9 deletions

View File

@ -46,6 +46,7 @@ IMPROVEMENTS:
- core: Mark `disabled` as true on forwarded port to disable. [GH-1922]
- core: NFS exports are now namespaced by user ID, so pruning NFS won't
remove exports from other users. [GH-1511]
- core: "vagrant -v" no longer loads the Vagrantfile
- commands/box/remove: Fix stack trace that happens if no provider
is specified. [GH-2100]
- commands/plugin/install: Post install message of a plugin will be

View File

@ -60,6 +60,12 @@ ARGV.each do |arg|
end
end
# Fast path the version of Vagrant
if ARGV.include?("-v") || ARGV.include?("--version")
puts "Vagrant v#{Vagrant::VERSION}"
exit 0
end
env = nil
begin
# Create the environment, which is the cwd of wherever the

View File

@ -14,15 +14,7 @@ module Vagrant
end
def execute
if @main_args.include?("-v") || @main_args.include?("--version")
# Version short-circuits the whole thing. Just print
# the version and exit.
@env.ui.info(I18n.t("vagrant.commands.version.output",
:version => Vagrant::VERSION),
:prefix => false)
return 0
elsif @main_args.include?("-h") || @main_args.include?("--help")
if @main_args.include?("-h") || @main_args.include?("--help")
# Help is next in short-circuiting everything. Print
# the help and exit.
help