From 1f9013047571997e64a02c8c44cffcafa9339e49 Mon Sep 17 00:00:00 2001 From: Tod Beardsley Date: Thu, 20 Sep 2012 13:34:29 -0500 Subject: [PATCH] Touchups to msfconsole command parsing Move from -s to -x and use a semicolon. --- lib/msf/ui/console/driver.rb | 4 ++-- msfconsole | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/msf/ui/console/driver.rb b/lib/msf/ui/console/driver.rb index 00547a5aed..eac24a576d 100644 --- a/lib/msf/ui/console/driver.rb +++ b/lib/msf/ui/console/driver.rb @@ -251,8 +251,8 @@ class Driver < Msf::Ui::Driver end # Process any additional startup commands - if opts['SCommands'] and opts['SCommands'].kind_of? Array - opts['SCommands'].each { |c| + if opts['XCommands'] and opts['XCommands'].kind_of? Array + opts['XCommands'].each { |c| run_single(c) } end diff --git a/msfconsole b/msfconsole index 17296a4c30..ea8add619e 100755 --- a/msfconsole +++ b/msfconsole @@ -101,9 +101,9 @@ class OptsConsole options['DisableBanner'] = true end - opts.on("-s", "-s ", "Execute the specified string as console commands") do |s| - options['SCommands'] ||= [] - options['SCommands'] += s.split('\n') + opts.on("-x", "-x ", "Execute the specified string as console commands (use ; for multiples)") do |s| + options['XCommands'] ||= [] + options['XCommands'] += s.split(/\s*;\s*/) end opts.separator ""