Compare commits
3 Commits
5d7fca4096
...
038e8a0b14
Author | SHA1 | Date | |
---|---|---|---|
038e8a0b14 | |||
b3d0e8c058 | |||
fbe8c494ec |
5
.gitignore
vendored
5
.gitignore
vendored
@ -3,8 +3,3 @@
|
||||
/bin/
|
||||
/.shards/
|
||||
*.dwarf
|
||||
|
||||
/src/views/
|
||||
|
||||
data.json
|
||||
pwd.yml
|
||||
|
10
HISTORY.md
Normal file
10
HISTORY.md
Normal file
@ -0,0 +1,10 @@
|
||||
## Legend
|
||||
- 🐛 - Bug
|
||||
- ✔️ - Fixed
|
||||
- ❌ - Removed
|
||||
- ➕ - Added
|
||||
- ℹ️ - Information
|
||||
- ♻️ - Edited
|
||||
|
||||
## 0.2.0 - [04/01/2022]
|
||||
- reading passwords file from program folder (portable mode)
|
@ -1,2 +1,6 @@
|
||||
version: 2.0
|
||||
shards: {}
|
||||
shards:
|
||||
ameba:
|
||||
git: https://github.com/crystal-ameba/ameba.git
|
||||
version: 0.14.3
|
||||
|
||||
|
11
shard.yml
11
shard.yml
@ -1,14 +1,17 @@
|
||||
name: passw0rd_manager
|
||||
name: pmng
|
||||
version: 0.1.0
|
||||
|
||||
authors:
|
||||
- Alexander Popov <iiiypuk@iiiypuk.me>
|
||||
|
||||
targets:
|
||||
passw0rd_manager:
|
||||
main: src/passw0rd_manager.cr
|
||||
pmng:
|
||||
main: src/pmng.cr
|
||||
|
||||
dependencies:
|
||||
development_dependencies:
|
||||
ameba:
|
||||
github: crystal-ameba/ameba
|
||||
version: ~> 0.14.0
|
||||
|
||||
crystal: 1.2.2
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
require "./spec_helper"
|
||||
|
||||
describe Passw0rdManager do
|
||||
# TODO: Write tests
|
||||
|
||||
it "works" do
|
||||
false.should eq(true)
|
||||
end
|
||||
end
|
@ -25,41 +25,46 @@ VERSION = "0.1.0"
|
||||
|
||||
begin
|
||||
OptionParser.parse do |parser|
|
||||
parser.banner = "Welcome to The Beatles App!"
|
||||
parser.banner = "pmng -- ver.: #{VERSION}\nThe very simple password manager for humans\n"
|
||||
|
||||
parser.on "-v", "--version", "Show version" do
|
||||
puts "Version #{VERSION}"
|
||||
exit
|
||||
exit(0)
|
||||
end
|
||||
parser.on "-h", "--help", "Show help" do
|
||||
puts parser
|
||||
exit
|
||||
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(:red)
|
||||
puts Random::Secure.urlsafe_base64(16, padding: false).colorize(:white).back(:blue)
|
||||
exit
|
||||
exit(0)
|
||||
end
|
||||
parser.on "-t", "--unixtime", "Return local timestamp" do
|
||||
puts Time.local.to_unix.colorize(:yellow)
|
||||
exit
|
||||
exit(0)
|
||||
end
|
||||
end
|
||||
rescue ex
|
||||
puts ex.message, ""
|
||||
end
|
||||
|
||||
if !File.exists?("pwd.yml")
|
||||
password_file_path = PROGRAM_NAME.split("/")
|
||||
password_file_path.pop
|
||||
password_file_path.insert(-1, "pwd.yml")
|
||||
password_file_path = password_file_path.join("/")
|
||||
|
||||
if File.exists?(password_file_path)
|
||||
yaml = File.open(password_file_path) do |file|
|
||||
YAML.parse(file)
|
||||
end
|
||||
else
|
||||
puts "No password.yml file exists."
|
||||
|
||||
exit(1)
|
||||
end
|
||||
|
||||
yaml = File.open("pwd.yml") do |file|
|
||||
YAML.parse(file)
|
||||
end
|
||||
|
||||
new_array = [] of Password
|
||||
count = 0
|
||||
while count < yaml.size
|
||||
@ -67,13 +72,14 @@ while count < yaml.size
|
||||
count += 1
|
||||
end
|
||||
|
||||
while true
|
||||
loop = true
|
||||
while loop
|
||||
print "Enter URL (or :q for exit)\n> "
|
||||
password_string = gets
|
||||
|
||||
if password_string.to_s == ":q"
|
||||
puts "Bye! 👋🏻"
|
||||
exit
|
||||
exit(0)
|
||||
elsif password_string.to_s == ":h"
|
||||
puts "Help:\n-----"
|
||||
puts ":s - Return stats"
|
Loading…
Reference in New Issue
Block a user