From 896ae7b9baebf8467ddf01eeff32d565e2a4e261 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 2 Sep 2013 15:43:59 -0700 Subject: [PATCH] core: vagrant -v no longer loads Vagrantfile --- CHANGELOG.md | 1 + bin/vagrant | 6 ++++++ lib/vagrant/cli.rb | 10 +--------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 334dfb7b8..bc193e1de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/bin/vagrant b/bin/vagrant index 7f4a41e98..0313bc796 100755 --- a/bin/vagrant +++ b/bin/vagrant @@ -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 diff --git a/lib/vagrant/cli.rb b/lib/vagrant/cli.rb index a224f7424..d771300c7 100644 --- a/lib/vagrant/cli.rb +++ b/lib/vagrant/cli.rb @@ -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