rework msftidy exit codes
parent
9b5350ff9c
commit
7578913058
|
@ -43,9 +43,10 @@ end
|
|||
class Msftidy
|
||||
|
||||
# Status codes
|
||||
OK = 0x00
|
||||
WARNINGS = 0x10
|
||||
ERRORS = 0x20
|
||||
OK = 0
|
||||
INFO = 1
|
||||
WARNING = 2
|
||||
ERROR = 3
|
||||
|
||||
# Some compiles regexes
|
||||
REGEX_MSF_EXPLOIT = / \< Msf::Exploit/
|
||||
|
@ -73,7 +74,7 @@ class Msftidy
|
|||
# error.
|
||||
def warn(txt, line=0) line_msg = (line>0) ? ":#{line}" : ''
|
||||
puts "#{@full_filepath}#{line_msg} - [#{'WARNING'.yellow}] #{cleanup_text(txt)}"
|
||||
@status == ERRORS ? @status = ERRORS : @status = WARNINGS
|
||||
@status += WARNING
|
||||
end
|
||||
|
||||
#
|
||||
|
@ -85,7 +86,7 @@ class Msftidy
|
|||
def error(txt, line=0)
|
||||
line_msg = (line>0) ? ":#{line}" : ''
|
||||
puts "#{@full_filepath}#{line_msg} - [#{'ERROR'.red}] #{cleanup_text(txt)}"
|
||||
@status = ERRORS
|
||||
@status += ERROR
|
||||
end
|
||||
|
||||
# Currently unused, but some day msftidy will fix errors for you.
|
||||
|
@ -101,6 +102,7 @@ class Msftidy
|
|||
return if SUPPRESS_INFO_MESSAGES
|
||||
line_msg = (line>0) ? ":#{line}" : ''
|
||||
puts "#{@full_filepath}#{line_msg} - [#{'INFO'.cyan}] #{cleanup_text(txt)}"
|
||||
@status += INFO
|
||||
end
|
||||
|
||||
##
|
||||
|
|
Loading…
Reference in New Issue