add colors to help output

This commit is contained in:
Alexander Popov 2022-05-02 11:04:29 +03:00
parent b2ec5fdfe1
commit d28d402d40
Signed by: iiiypuk
GPG Key ID: 3F76816AEE08F908
3 changed files with 21 additions and 6 deletions

View File

@ -6,10 +6,11 @@
- - Information - - Information
- ♻️ - Edited - ♻️ - Edited
## 0.2.3 - [09/04/2022] ## 0.2.3 - [02/05/2022]
- ♻️ - Password outdated date change to 3 month - ♻️ - Password outdated date change to 3 month
- - Added `pmng` logo - - Added `pmng` logo
- - Added show count finded records - - Added show count finded records
- - Added colors to help output
## 0.2.2 - [08/04/2022] ## 0.2.2 - [08/04/2022]
- - Added check permissions for password file - - Added check permissions for password file

View File

@ -1,4 +1,4 @@
# The very simple password manager for humans # 🔑 The very simple password manager for humans
``` ```
██████╗ ███╗ ███╗███╗ ██╗ ██████╗ ██████╗ ███╗ ███╗███╗ ██╗ ██████╗
@ -8,3 +8,10 @@
██║ ██║ ╚═╝ ██║██║ ╚████║╚██████╔╝ ██║ ██║ ╚═╝ ██║██║ ╚████║╚██████╔╝
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
``` ```
# 💾 Download
- [Linux x86_64](https://me.a2s.su/.../)
- [Linux x86](https://me.a2s.su/.../)
- [Linux x86_64 musl](https://me.a2s.su/.../)
- [OpenBSD x86_64](https://me.a2s.su/.../)

View File

@ -39,23 +39,30 @@ begin
parser.banner = "The very simple password manager for humans\n" parser.banner = "The very simple password manager for humans\n"
parser.on "-v", "--version", "Show version" do parser.on "-v", "--version", "Show version" do
puts ASCII_LOGO puts ASCII_LOGO.colorize(:yellow)
puts "The very simple password manager for humans." puts "The very simple password manager for humans.".colorize(:yellow)
puts "Version #{VERSION}" print "Version ".colorize(:yellow)
puts VERSION.colorize(:red).mode(:bold)
print "\nURL to full change log: ".colorize(:yellow)
puts "https://git.a2s.su/iiiypuk/pmng/raw/branch/master/HISTORY.md".colorize(:green).mode(:bold)
exit(0) exit(0)
end end
parser.on "-h", "--help", "Show help" do parser.on "-h", "--help", "Show help" do
puts parser puts parser
exit(0) 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(:blue) puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:white).back(:blue)
puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:white).back(:red) puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:white).back(:red)
exit(0) 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).mode(:bold) puts Time.local.to_unix.colorize(:yellow).mode(:bold)
exit(0) exit(0)
end end
end end
@ -116,6 +123,7 @@ while loop
# if ':q' to close program # if ':q' to close program
system "clear" system "clear"
puts "Bye! 👋" puts "Bye! 👋"
exit(0) exit(0)
elsif password_string.to_s.size == 0 elsif password_string.to_s.size == 0
# if puts empty, retry prompt # if puts empty, retry prompt
@ -165,7 +173,6 @@ while loop
end end
if !item.login.blank? if !item.login.blank?
# print "\u{1F3F7}\u{FE0F} "
print "🗿 " print "🗿 "
puts item.login.colorize(:yellow) puts item.login.colorize(:yellow)
end end