CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/lib/rex/ui/output.rb
Views: 1904
1
# -*- coding: binary -*-
2
3
module Rex
4
module Ui
5
6
###
7
#
8
# This class acts as a generic base class for outputting data. It
9
# only provides stubs for the simplest form of outputting information.
10
#
11
###
12
class Output
13
14
# General output
15
16
# Text-based output
17
18
#
19
# Prints an error message.
20
#
21
def print_error(msg='')
22
end
23
24
alias_method :print_bad, :print_error
25
26
#
27
# Prints a 'good' message.
28
#
29
def print_good(msg='')
30
end
31
32
#
33
# Prints a status line.
34
#
35
def print_status(msg='')
36
end
37
38
#
39
# Prints an undecorated line of information.
40
#
41
def print_line(msg='')
42
end
43
44
#
45
# Prints a warning
46
#
47
def print_warning(msg='')
48
end
49
50
#
51
# Prints a message with no decoration.
52
#
53
def print(msg='')
54
end
55
56
#
57
# Flushes any buffered output.
58
#
59
def flush
60
end
61
62
#
63
# Called to tell the output medium that we're at a prompt.
64
# This is used to allow the output medium to display an extra
65
# carriage return
66
#
67
def prompting(v = true)
68
@at_prompt = v
69
end
70
71
#
72
# Returns whether or not we're at a prompt currently
73
#
74
def prompting?
75
@at_prompt
76
end
77
78
end
79
80
end
81
end
82
83