Skip to content

Commit

Permalink
Added ability for custom exit to avoid message printing
Browse files Browse the repository at this point in the history
  • Loading branch information
OscarAkaElvis committed Jul 18, 2019
1 parent 54829dd commit b30f90a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions evil-winrm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,16 @@ def paths(directory)
end

# Custom exit
def custom_exit(exit_code = 0)
if exit_code == 0 then
puts()
self.print_message("Exiting with code " + exit_code.to_s, TYPE_INFO)
elsif exit_code == 1 then
self.print_message("Exiting with code " + exit_code.to_s, TYPE_ERROR)
else
self.print_message("Exiting with code " + exit_code.to_s, TYPE_ERROR)
def custom_exit(exit_code = 0, message_print=true)
if message_print then
if exit_code == 0 then
puts()
self.print_message("Exiting with code " + exit_code.to_s, TYPE_INFO)
elsif exit_code == 1 then
self.print_message("Exiting with code " + exit_code.to_s, TYPE_ERROR)
else
self.print_message("Exiting with code " + exit_code.to_s, TYPE_ERROR)
end
end
exit(exit_code)
end
Expand Down

0 comments on commit b30f90a

Please sign in to comment.