qute-pass: Support folder prefixes in gopass-mode
This commit is contained in:
parent
b8c2c8d381
commit
3b54d45cd9
|
|
@ -77,6 +77,8 @@ argument_parser.add_argument('--password-store', '-p',
|
|||
help='Path to your pass password-store (only used in pass-mode)', type=expanded_path)
|
||||
argument_parser.add_argument('--mode', '-M', choices=['pass', 'gopass'], default="pass",
|
||||
help='Select mode [gopass] to use gopass instead of the standard pass.')
|
||||
argument_parser.add_argument('--prefix', type=str,
|
||||
help='Search only the given subfolder of the store (only used in gopass-mode)')
|
||||
argument_parser.add_argument('--username-pattern', '-u', default=r'.*/(.+)',
|
||||
help='Regular expression that matches the username')
|
||||
argument_parser.add_argument('--username-target', '-U', choices=['path', 'secret'], default='path',
|
||||
|
|
@ -132,7 +134,10 @@ def find_pass_candidates(domain, unfiltered=False):
|
|||
candidates = []
|
||||
|
||||
if arguments.mode == "gopass":
|
||||
all_passwords = subprocess.run(["gopass", "list", "--flat" ], stdout=subprocess.PIPE).stdout.decode("UTF-8").splitlines()
|
||||
gopass_args = ["gopass", "list", "--flat"]
|
||||
if arguments.prefix:
|
||||
gopass_args.append(arguments.prefix)
|
||||
all_passwords = subprocess.run(gopass_args, stdout=subprocess.PIPE).stdout.decode("UTF-8").splitlines()
|
||||
|
||||
for password in all_passwords:
|
||||
if unfiltered or domain in password:
|
||||
|
|
|
|||
Loading…
Reference in New Issue