Extract Msf::Module::UI::Line

MSP-11126
bug/bundler_fix
Luke Imhoff 2014-10-16 09:50:07 -05:00
parent 96864b3892
commit a9a6f0c5f9
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
3 changed files with 12 additions and 12 deletions

View File

@ -176,18 +176,6 @@ class Module
obj obj
end end
#
# Overwrite the Subscriber print_line to do custom prefixes
#
def print_line_prefix
datastore['CustomPrintPrefix'] || framework.datastore['CustomPrintPrefix'] || ''
end
def print_line(msg='')
super(print_line_prefix + msg)
end
# Verbose version of #print_status # Verbose version of #print_status
def vprint_status(msg) def vprint_status(msg)
print_status(msg) if datastore['VERBOSE'] || framework.datastore['VERBOSE'] print_status(msg) if datastore['VERBOSE'] || framework.datastore['VERBOSE']

View File

@ -1,4 +1,5 @@
module Msf::Module::UI module Msf::Module::UI
autoload :Line, 'msf/core/module/ui/line'
autoload :Message, 'msf/core/module/ui/message' autoload :Message, 'msf/core/module/ui/message'
# Modules can subscribe to a user-interface, and as such they include the # Modules can subscribe to a user-interface, and as such they include the
@ -8,6 +9,8 @@ module Msf::Module::UI
# interacting with the user, n stuff. # interacting with the user, n stuff.
include Rex::Ui::Subscriber include Rex::Ui::Subscriber
# Overwrite the {Rex::UI::Subscriber#print_line} to do custom prefixes
include Msf::Module::UI::Line
# Overwrite the {Rex::Ui::Subscriber} print_(status|error|good) to do time stamps # Overwrite the {Rex::Ui::Subscriber} print_(status|error|good) to do time stamps
include Msf::Module::UI::Message include Msf::Module::UI::Message
end end

View File

@ -0,0 +1,9 @@
module Msf::Module::UI::Line
def print_line(msg='')
super(print_line_prefix + msg)
end
def print_line_prefix
datastore['CustomPrintPrefix'] || framework.datastore['CustomPrintPrefix'] || ''
end
end