fast-path vagrant --version
This commit is contained in:
parent
177bfc1d0c
commit
e800743d06
17
bin/vagrant
17
bin/vagrant
|
@ -5,8 +5,17 @@
|
||||||
# initializing which have historically resulted in stack traces.
|
# initializing which have historically resulted in stack traces.
|
||||||
Signal.trap("INT") { abort }
|
Signal.trap("INT") { abort }
|
||||||
|
|
||||||
|
# Split arguments by "--" if its there, we'll recombine them later
|
||||||
|
argv = ARGV.dup
|
||||||
|
argv_extra = []
|
||||||
|
if idx = argv.index("--")
|
||||||
|
argv_extra = argv.slice(idx+1, argv.length-2)
|
||||||
|
argv = argv.slice(0, idx)
|
||||||
|
end
|
||||||
|
|
||||||
# Fast path the version of Vagrant
|
# Fast path the version of Vagrant
|
||||||
if argv.include?("-v") || argv.include?("--version")
|
if argv.include?("-v") || argv.include?("--version")
|
||||||
|
require "vagrant/version"
|
||||||
puts "Vagrant #{Vagrant::VERSION}"
|
puts "Vagrant #{Vagrant::VERSION}"
|
||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
|
@ -23,14 +32,6 @@ if !ENV["VAGRANT_INTERNAL_BUNDLERIZED"]
|
||||||
raise "Fatal error: this line should never be reached"
|
raise "Fatal error: this line should never be reached"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Split arguments by "--" if its there, we'll recombine them later
|
|
||||||
argv = ARGV.dup
|
|
||||||
argv_extra = []
|
|
||||||
if idx = argv.index("--")
|
|
||||||
argv_extra = argv.slice(idx+1, argv.length-2)
|
|
||||||
argv = argv.slice(0, idx)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Set logging level to `debug`. This is done before loading 'vagrant', as it
|
# Set logging level to `debug`. This is done before loading 'vagrant', as it
|
||||||
# sets up the logging system.
|
# sets up the logging system.
|
||||||
if argv.include?("--debug")
|
if argv.include?("--debug")
|
||||||
|
|
Loading…
Reference in New Issue