Skip to content

Commit b864c46

Browse files
committed
msftidy - added info messages
this commit adds info messages to msftidy to show some info, but stil exit with status 0 if there are not errors.
1 parent fc803ae commit b864c46

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

tools/msftidy.rb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ def green
3030
"\e[1;32;40m#{self}\e[0m"
3131
end
3232

33+
def cyan
34+
"\e[1;36;40m#{self}\e[0m"
35+
end
36+
3337
def ascii_only?
3438
self =~ Regexp.new('[\x00-\x08\x0b\x0c\x0e-\x19\x7f-\xff]', nil, 'n') ? false : true
3539
end
@@ -83,6 +87,13 @@ def fixed(txt, line=0)
8387
puts "#{@full_filepath}#{line_msg} - [#{'FIXED'.green}] #{cleanup_text(txt)}"
8488
end
8589

90+
#
91+
# Display an info message. Info messages do not alter the exit status.
92+
#
93+
def info(txt, line=0)
94+
line_msg = (line>0) ? ":#{line}" : ''
95+
puts "#{@full_filepath}#{line_msg} - [#{'INFO'.cyan}] #{cleanup_text(txt)}"
96+
end
8697

8798
##
8899
#
@@ -490,10 +501,10 @@ def check_vars_get
490501
test.each { |item|
491502
case item[1]
492503
when 'cgi'
493-
warn("Please use vars_get in send_request_cgi: #{item[0]}")
504+
info("Please use vars_get in send_request_cgi: #{item[0]}")
494505
when 'raw'
495-
# send_request_raw does not support vars_getiirb
496-
warn("Please use vars_get and switch to send_request_cgi: #{item[0]}")
506+
# send_request_raw does not support vars_get
507+
info("Please use vars_get and switch to send_request_cgi: #{item[0]}")
497508
else
498509
raise('Error in regex')
499510
end

0 commit comments

Comments
 (0)