From d28d402d4012e6106ceb4a363b9a2d1182469e1f Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 2 May 2022 11:04:29 +0300 Subject: [PATCH] add colors to help output --- HISTORY.md | 3 ++- README.md | 9 ++++++++- src/pmng.cr | 15 +++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 9f309ca..736ec2b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,10 +6,11 @@ - ℹ️ - Information - ♻️ - Edited -## 0.2.3 - [09/04/2022] +## 0.2.3 - [02/05/2022] - ♻️ - Password outdated date change to 3 month - ➕ - Added `pmng` logo - ➕ - Added show count finded records +- ➕ - Added colors to help output ## 0.2.2 - [08/04/2022] - ➕ - Added check permissions for password file diff --git a/README.md b/README.md index 2772ccc..2d3c39b 100644 --- a/README.md +++ b/README.md @@ -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/.../) diff --git a/src/pmng.cr b/src/pmng.cr index 4a94912..a660246 100644 --- a/src/pmng.cr +++ b/src/pmng.cr @@ -39,23 +39,30 @@ begin parser.banner = "The very simple password manager for humans\n" parser.on "-v", "--version", "Show version" do - puts ASCII_LOGO - puts "The very simple password manager for humans." - puts "Version #{VERSION}" + puts ASCII_LOGO.colorize(:yellow) + puts "The very simple password manager for humans.".colorize(:yellow) + 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) end parser.on "-h", "--help", "Show help" do puts parser + exit(0) end 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(:white).back(:blue) puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:white).back(:red) + exit(0) end parser.on "-t", "--unixtime", "Return local timestamp" do puts Time.local.to_unix.colorize(:yellow).mode(:bold) + exit(0) end end @@ -116,6 +123,7 @@ while loop # if ':q' to close program system "clear" puts "Bye! 👋" + exit(0) elsif password_string.to_s.size == 0 # if puts empty, retry prompt @@ -165,7 +173,6 @@ while loop end if !item.login.blank? - # print "\u{1F3F7}\u{FE0F} " print "🗿 " puts item.login.colorize(:yellow) end