2005-07-14 22:45:10 +00:00
|
|
|
require 'rex/ui'
|
|
|
|
|
|
|
|
module Rex
|
|
|
|
module Ui
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# This class acts as a generic base class for outputing data. It
|
|
|
|
# only provides stubs for the simplest form of outputing information.
|
|
|
|
#
|
|
|
|
###
|
|
|
|
class Output
|
|
|
|
|
2005-07-17 02:04:39 +00:00
|
|
|
# General output
|
|
|
|
require 'rex/ui/output/none'
|
|
|
|
|
|
|
|
# Text-based output
|
2005-07-14 22:45:10 +00:00
|
|
|
require 'rex/ui/text/output'
|
|
|
|
|
2006-09-12 05:34:58 +00:00
|
|
|
attr_accessor :on_print_proc
|
|
|
|
|
2005-07-14 22:45:10 +00:00
|
|
|
#
|
|
|
|
# Prints an error message.
|
|
|
|
#
|
2007-02-11 19:40:33 +00:00
|
|
|
def print_error(msg='')
|
2005-07-14 22:45:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Prints a 'good' message.
|
|
|
|
#
|
2007-02-11 19:40:33 +00:00
|
|
|
def print_good(msg='')
|
2005-07-14 22:45:10 +00:00
|
|
|
end
|
|
|
|
|
2010-02-02 21:03:07 +00:00
|
|
|
def print_debug(msg='')
|
|
|
|
end
|
|
|
|
|
2005-07-14 22:45:10 +00:00
|
|
|
#
|
|
|
|
# Prints a status line.
|
|
|
|
#
|
2007-02-11 19:40:33 +00:00
|
|
|
def print_status(msg='')
|
2005-07-14 22:45:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Prints an undecorated line of information.
|
|
|
|
#
|
2007-02-11 19:40:33 +00:00
|
|
|
def print_line(msg='')
|
2005-07-14 22:45:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
2005-07-17 02:04:39 +00:00
|
|
|
# Prints a message with no decoration.
|
2005-07-14 22:45:10 +00:00
|
|
|
#
|
2007-02-11 19:40:33 +00:00
|
|
|
def print(msg='')
|
2005-07-14 22:45:10 +00:00
|
|
|
end
|
|
|
|
|
2005-07-17 02:04:39 +00:00
|
|
|
#
|
|
|
|
# Flushes any buffered output.
|
|
|
|
#
|
|
|
|
def flush
|
|
|
|
end
|
|
|
|
|
2007-04-04 02:38:15 +00:00
|
|
|
#
|
|
|
|
# Called to tell the output medium that we're at a prompt.
|
|
|
|
# This is used to allow the output medium to display an extra
|
|
|
|
# carriage return
|
|
|
|
#
|
|
|
|
def prompting(v = true)
|
|
|
|
@at_prompt = v
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns whether or not we're at a prompt currently
|
|
|
|
#
|
|
|
|
def prompting?
|
|
|
|
@at_prompt
|
|
|
|
end
|
|
|
|
|
2005-07-14 22:45:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2009-11-10 06:58:01 +00:00
|
|
|
end
|