2007-02-18 12:27:17 +00:00
|
|
|
module Msf
|
|
|
|
module Ui
|
|
|
|
|
|
|
|
#
|
|
|
|
# Common functions needed by more than one user interface
|
|
|
|
#
|
|
|
|
class Common
|
|
|
|
|
|
|
|
# Process the command line argument vector, handling common global
|
|
|
|
# var/value pairs that can be used to control additional framework
|
|
|
|
# features
|
|
|
|
def self.process_cli_arguments(framework, argv)
|
|
|
|
argv.delete_if { |assign|
|
2009-06-09 20:43:42 +00:00
|
|
|
var, val = assign.split('=', 2)
|
2007-02-18 12:27:17 +00:00
|
|
|
|
|
|
|
next if var.nil? or val.nil?
|
|
|
|
|
|
|
|
case var.downcase
|
|
|
|
# Add an additional module search path
|
|
|
|
when "modulepath"
|
2007-02-24 03:32:32 +00:00
|
|
|
# Don't affect the module cache by us loading these modules
|
|
|
|
framework.modules.add_module_path(val, false)
|
2007-02-18 12:27:17 +00:00
|
|
|
true
|
|
|
|
else
|
|
|
|
false
|
|
|
|
end
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2009-06-09 20:43:42 +00:00
|
|
|
end
|