diff --git a/HISTORY.md b/HISTORY.md index e01d228..a3de609 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -6,5 +6,9 @@ - ℹ️ - Information - ♻️ - Edited +## 0.2.1 - [13/03/2022] +- ✔️ - fixed empty search field +- ✔️ - fixed password generate colors to russian flag + ## 0.2.0 - [04/01/2022] - reading passwords file from program folder (portable mode) diff --git a/src/pmng.cr b/src/pmng.cr index b1724e0..73b6b52 100644 --- a/src/pmng.cr +++ b/src/pmng.cr @@ -21,7 +21,7 @@ class Password property update : Int32 end -VERSION = "0.1.0" +VERSION = "0.2.1" begin OptionParser.parse do |parser| @@ -37,8 +37,8 @@ begin 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(:red) 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 @@ -80,6 +80,8 @@ while loop if password_string.to_s == ":q" puts "Bye! 👋🏻" exit(0) + elsif password_string.to_s.size == 0 + puts elsif password_string.to_s == ":h" puts "Help:\n-----" puts ":s - Return stats" @@ -101,29 +103,29 @@ while loop end puts outdated_count - end + else + new_array.each do |item| + if item.url.includes?(password_string.to_s) + puts item.url.colorize(:magenta).mode(:blink) - new_array.each do |item| - if item.url.includes?(password_string.to_s) - puts item.url.colorize(:magenta).mode(:blink) + if !item.email.blank? + puts item.email.colorize(:red) + end + if !item.login.blank? + puts item.login.colorize(:yellow) + end + if !item.password.blank? + puts item.password.colorize(:red).back(:red) + end + if !item.desc.blank? + puts item.desc.colorize(:cyan) + end + if !item.profile_url.blank? + puts item.profile_url.colorize(:green) + end - if !item.email.blank? - puts item.email.colorize(:red) + puts "---".colorize(:dark_gray) end - if !item.login.blank? - puts item.login.colorize(:yellow) - end - if !item.password.blank? - puts item.password.colorize(:red).back(:red) - end - if !item.desc.blank? - puts item.desc.colorize(:cyan) - end - if !item.profile_url.blank? - puts item.profile_url.colorize(:green) - end - - puts "---".colorize(:dark_gray) end end