fix error where commands was nil

git-svn-id: file:///home/svn/framework3/trunk@11335 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Joshua Drake 2010-12-14 19:28:44 +00:00
parent 1c2c3ed1f6
commit de69a2b9bf
1 changed files with 19 additions and 18 deletions

View File

@ -63,6 +63,7 @@ def usage
raise Rex::Script::Completed
end
################## Main ##################
@@exec_opts.parse(args) { |opt, idx, val|
case opt
@ -74,6 +75,7 @@ end
if not ::File.exists?(script)
raise "Command List File does not exists!"
else
commands ||= ''
::File.open(script, "r").each_line do |line|
commands << line.chomp
end
@ -83,7 +85,6 @@ end
when "-h"
help = 1
end
}
if args.length == 0 or help == 1