Compare commits
2 Commits
ddaa870668
...
70153a6e42
Author | SHA1 | Date | |
---|---|---|---|
70153a6e42 | |||
d72acba22c |
15
HISTORY.md
15
HISTORY.md
@ -7,14 +7,15 @@
|
||||
- ♻️ - Edited
|
||||
|
||||
## 0.2.2 - [08/04/2022]
|
||||
- 🐛 - Before label emoji not insert space symbol (temponary change emoji)
|
||||
- ➕ - Added check permissions for password file
|
||||
- ➕ - Added title by start program
|
||||
- ➕ - Added clear terminal by new search
|
||||
- ➕ - Added by start&close program clear terminal
|
||||
- ➕ - Added help tooltip to prompt
|
||||
- ➕ - Added emoji to output
|
||||
- ✔️ - Fixed BYE emoji color
|
||||
- ♻️ - Edited URL color & style output
|
||||
- ➕ - Added terminal cleaning functionality
|
||||
- ➕ - Added help tips to user prompt
|
||||
- ➕ - Added emoji for output
|
||||
- ➕ - Added colors for help sections
|
||||
- ✔️ - Fixed bug on bye emoji color
|
||||
- ♻️ - Edited color & style for data output
|
||||
- 🐛 - After emoji label not view space symbol (emoji temporary changed)
|
||||
|
||||
## 0.2.1 - [14/03/2022]
|
||||
- ➕ - prompt '>' set color green
|
||||
|
42
src/pmng.cr
42
src/pmng.cr
@ -80,6 +80,15 @@ while count < yaml.size
|
||||
count += 1
|
||||
end
|
||||
|
||||
# check file ppermissions
|
||||
password_file_permissions = File.info(password_file_path).permissions.to_s
|
||||
|
||||
if /\d{3}/.match(password_file_permissions).try &.[0] != "600"
|
||||
puts "Password file permissions is not RW for you.".colorize(:red)
|
||||
|
||||
exit(1)
|
||||
end
|
||||
|
||||
# pmng title
|
||||
system "clear"
|
||||
puts "The very simple password manager for humans".colorize(:yellow).mode(:bold)
|
||||
@ -98,25 +107,31 @@ while loop
|
||||
|
||||
password_string = gets
|
||||
|
||||
# if ':q' to close program
|
||||
if password_string.to_s == ":q"
|
||||
# if ':q' to close program
|
||||
system "clear"
|
||||
puts "Bye! 👋"
|
||||
exit(0)
|
||||
# if puts empty, retry prompt
|
||||
elsif password_string.to_s.size == 0
|
||||
# if puts empty, retry prompt
|
||||
puts
|
||||
# if ':h' to view help
|
||||
elsif password_string.to_s == ":h"
|
||||
puts "Help:\n-----"
|
||||
puts ":s - Return stats"
|
||||
# if ':s' to view Statistics
|
||||
# if ':h' to view help
|
||||
system "clear"
|
||||
|
||||
puts "Help\n----".colorize(:yellow).mode(:bold)
|
||||
print ":s".colorize(:red).mode(:bold)
|
||||
puts " - Return stats"
|
||||
elsif password_string.to_s == ":s"
|
||||
puts "Statistics:\n----------"
|
||||
print "Elements: ".colorize(:yellow)
|
||||
# if ':s' to view Statistics
|
||||
system "clear"
|
||||
|
||||
puts "Statistics\n----------".colorize(:yellow).mode(:bold)
|
||||
|
||||
print "All elements: ".colorize(:yellow).mode(:bold)
|
||||
puts passwords_array.size
|
||||
|
||||
print "Outdated: ".colorize(:red)
|
||||
print "Passwords outdated: ".colorize(:red).mode(:bold)
|
||||
outdated_count = 0
|
||||
current_time = Time.local.to_unix
|
||||
a = [] of String
|
||||
@ -128,8 +143,8 @@ while loop
|
||||
end
|
||||
|
||||
puts outdated_count
|
||||
# list search password
|
||||
else
|
||||
# list search password
|
||||
system "clear"
|
||||
|
||||
passwords_array.each do |item|
|
||||
@ -141,18 +156,23 @@ while loop
|
||||
print "📧 "
|
||||
puts item.email.colorize(:red)
|
||||
end
|
||||
|
||||
if !item.login.blank?
|
||||
print "🏷️ "
|
||||
# print "🏷️ " # Bug
|
||||
print "🗿 "
|
||||
puts item.login.colorize(:yellow)
|
||||
end
|
||||
|
||||
if !item.password.blank?
|
||||
print "🔐 "
|
||||
puts item.password.colorize(:red).back(:red)
|
||||
end
|
||||
|
||||
if !item.desc.blank?
|
||||
print "📄 "
|
||||
puts item.desc.colorize(:cyan)
|
||||
end
|
||||
|
||||
if !item.profile_url.blank?
|
||||
print "👦 "
|
||||
puts item.profile_url.colorize(:green)
|
||||
|
Loading…
Reference in New Issue
Block a user