delay framework load until after option parsing

git-svn-id: file:///home/svn/framework3/trunk@9367 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
Joshua Drake 2010-05-25 22:29:01 +00:00
parent 563ab310dc
commit b44a2a169c
1 changed files with 16 additions and 1 deletions

View File

@ -17,7 +17,6 @@ $:.unshift(File.join(File.expand_path(File.dirname(msfbase)), 'lib'))
$:.unshift(ENV['MSF_LOCAL_LIB']) if ENV['MSF_LOCAL_LIB']
require 'rex'
require 'msf/ui'
require 'optparse'
if(RUBY_PLATFORM =~ /mswin32/)
@ -88,6 +87,22 @@ class OptsConsole
end
options = OptsConsole.parse(ARGV)
#
# NOTE: we don't require this until down here since we may not need it
# when processing certain options (currently only -h)
#
require 'msf/ui'
#
# Everything below this line requires the framework.
#
#
# XXX: It would be nice to not have to load the entire framework just to get
# the version number.
#
if (options['Version'])
$stderr.puts 'Framework Version: ' + Msf::Framework::Version
exit