fix exit()

This commit is contained in:
Alexander Popov 2022-01-04 00:52:31 +03:00
parent fbe8c494ec
commit b3d0e8c058
1 changed files with 5 additions and 5 deletions

View File

@ -29,21 +29,21 @@ begin
parser.on "-v", "--version", "Show version" do parser.on "-v", "--version", "Show version" do
puts "Version #{VERSION}" puts "Version #{VERSION}"
exit exit(0)
end end
parser.on "-h", "--help", "Show help" do parser.on "-h", "--help", "Show help" do
puts parser puts parser
exit exit(0)
end end
parser.on "-g", "--generate-password", "Generate password" do parser.on "-g", "--generate-password", "Generate password" do
puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:black).back(:white) puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:black).back(:white)
puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:white).back(:red) puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:white).back(:red)
puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:white).back(:blue) puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:white).back(:blue)
exit exit(0)
end end
parser.on "-t", "--unixtime", "Return local timestamp" do parser.on "-t", "--unixtime", "Return local timestamp" do
puts Time.local.to_unix.colorize(:yellow) puts Time.local.to_unix.colorize(:yellow)
exit exit(0)
end end
end end
rescue ex rescue ex
@ -74,7 +74,7 @@ while loop
if password_string.to_s == ":q" if password_string.to_s == ":q"
puts "Bye! 👋🏻" puts "Bye! 👋🏻"
exit exit(0)
elsif password_string.to_s == ":h" elsif password_string.to_s == ":h"
puts "Help:\n-----" puts "Help:\n-----"
puts ":s - Return stats" puts ":s - Return stats"