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