allow multiple resource files on the command line

git-svn-id: file:///home/svn/framework3/trunk@8357 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2010-02-02 23:13:42 +00:00
parent 65a303ee93
commit ea0f4d2e46
2 changed files with 11 additions and 3 deletions

View File

@ -151,7 +151,14 @@ class Driver < Msf::Ui::Driver
on_startup
# Process the resource script
load_resource(opts['Resource'])
if opts['Resource'] and opts['Resource'].kind_of? Array
opts['Resource'].each { |r|
load_resource(r)
}
else
# If the opt is nil here, we load ~/.msf3/msfconsole.rc
load_resource(opts['Resource'])
end
end
#
@ -226,7 +233,7 @@ class Driver < Msf::Ui::Driver
line.strip!
next if line.length == 0
next if line =~ /^#/
print_line("resource> #{line}")
print_line("resource (#{path})> #{line}")
run_single(line)
end
rcfd.close

View File

@ -41,7 +41,8 @@ class OptsConsole
end
opts.on("-r", "-r <filename>", "Execute the specified resource file") do |r|
options['Resource'] = r
options['Resource'] ||= []
options['Resource'] << r
end
opts.on("-c", "-c <filename>", "Load the specified configuration file") do |c|