Browse Source

add my own lesspass cli

master
Markus Bergholz 2 years ago
parent
commit
2903a81a1f
  1. 20
      python/mylp

20
python/mylp

@ -0,0 +1,20 @@
#!/usr/bin/python
import json
import yaml
import sys
from getpass import getpass
from lesspass.password import generate_password
if __name__ == '__main__':
#arg = "ansible-vault-private_key.json"
arg = sys.argv[1]
if arg.find(".yml") == (len(arg) -4):
profile = yaml.load(open(arg))
elif arg.find(".json") == (len(arg) -5):
profile = json.load(open(arg))
else:
print("cannot parse profile file")
sys.exit(1)
master_password = getpass("Master Password: ")
print(generate_password(profile, master_password))
Loading…
Cancel
Save