Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/msf/core/module/ui/line/verbose.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Msf::Module::UI::Line::Verbose
TRUE_REGEX = /^(y|yes|t|1|true)$/i
# Verbose version of #print_line
def vprint_line(msg='')
print_line(msg) if datastore['VERBOSE'] || framework.datastore['VERBOSE']
def vprint_line(msg = '')
print_line(msg) if datastore['VERBOSE'].to_s =~ TRUE_REGEX || (!framework.nil? && framework.datastore['VERBOSE'].to_s =~ TRUE_REGEX)
end
end
18 changes: 10 additions & 8 deletions lib/msf/core/module/ui/message/verbose.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
module Msf::Module::UI::Message::Verbose
TRUE_REGEX = /^(y|yes|t|1|true)$/i
# Verbose version of #print_error
def vprint_error(msg='')
print_error(msg) if datastore['VERBOSE'] || (!framework.nil? && framework.datastore['VERBOSE'])
def vprint_error(msg = '')
print_error(msg) if datastore['VERBOSE'].to_s =~ TRUE_REGEX || (!framework.nil? && framework.datastore['VERBOSE'].to_s =~ TRUE_REGEX)
end

alias_method :vprint_bad, :vprint_error
alias vprint_bad vprint_error

# Verbose version of #print_good
def vprint_good(msg='')
def vprint_good(msg = '')
print_good(msg) if datastore['VERBOSE'] || (!framework.nil? && framework.datastore['VERBOSE'])
end
alias vprint_bad vprint_error

# Verbose version of #print_status
def vprint_status(msg='')
print_status(msg) if datastore['VERBOSE'] || (!framework.nil? && framework.datastore['VERBOSE'])
def vprint_status(msg = '')
print_status(msg) if datastore['VERBOSE'].to_s =~ TRUE_REGEX || (!framework.nil? && framework.datastore['VERBOSE'].to_s =~ TRUE_REGEX)
end

# Verbose version of #print_warning
def vprint_warning(msg='')
print_warning(msg) if datastore['VERBOSE'] || (!framework.nil? && framework.datastore['VERBOSE'])
def vprint_warning(msg = '')
print_warning(msg) if datastore['VERBOSE'].to_s =~ TRUE_REGEX || (!framework.nil? && framework.datastore['VERBOSE'].to_s =~ TRUE_REGEX)
end
end
Loading