Single char args multicommand

bug/bundler_fix
Josh Hale 2017-08-06 17:52:07 -05:00
parent 40313bf623
commit d0419cdfb8
1 changed files with 4 additions and 4 deletions

View File

@ -16,9 +16,9 @@ wininfo = client.sys.config.sysinfo
# Setting Arguments # Setting Arguments
@@exec_opts = Rex::Parser::Arguments.new( @@exec_opts = Rex::Parser::Arguments.new(
"-h" => [ false,"Help menu." ], "-h" => [ false,"Help menu." ],
"-cl" => [ true,"Commands to execute. The command must be enclosed in double quotes and separated by a comma."], "-c" => [ true,"Commands to execute. The command must be enclosed in double quotes and separated by a comma."],
"-f" => [ true,"File where to saved output of command."], "-f" => [ true,"File where to saved output of command."],
"-rc" => [ true,"Text file with list of commands, one per line."] "-r" => [ true,"Text file with list of commands, one per line."]
) )
#Setting Argument variables #Setting Argument variables
commands = [] commands = []
@ -77,9 +77,9 @@ end
@@exec_opts.parse(args) { |opt, idx, val| @@exec_opts.parse(args) { |opt, idx, val|
case opt case opt
when "-cl" when "-c"
commands = val.split(",") commands = val.split(",")
when "-rc" when "-r"
script = val script = val
if not ::File.exist?(script) if not ::File.exist?(script)
raise "Command List File does not exists!" raise "Command List File does not exists!"