-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_pass_storage.py
24 lines (20 loc) · 957 Bytes
/
run_pass_storage.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import argparse
from storage_utils.pass_interaction_app import PassStorage
if __name__ == "__main__":
parser = argparse.ArgumentParser('Command line parser', formatter_class=argparse.RawTextHelpFormatter)
parser.add_argument('-s', help='service name', type=str, default=None)
parser.add_argument('-acc', help='account login', type=str, default=None)
parser.add_argument('-p',
help='print mode. \n'
'default -- copy to clipboard\n'
'short -- only service, login and password\n'
'full -- all account info',
type=str, default=None)
args = parser.parse_args()
assert args.p in {'short', 'full', None}, f'{args.p} not short or full'
if any(args.__dict__.values()):
p = PassStorage()
p.run_with_params(args.s, args.acc, args.p)
else:
p = PassStorage()
p.run()