summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-08-21 16:35:58 +0200
committerFlorian Bruhin <me@the-compiler.org>2021-08-21 16:35:58 +0200
commit5dec8e13c5b13550bd2b212cf20ee9a6826f193d (patch)
tree988004e53f5cb25b0d1f5a939756d57309668e4b
parent222755d0e9050874c82718e5ecd1024a68f3e91c (diff)
parent6ba917d5ecf9f7ccd8a335f4a5ccfe45f3f13083 (diff)
downloadqutebrowser-5dec8e13c5b13550bd2b212cf20ee9a6826f193d.tar.gz
qutebrowser-5dec8e13c5b13550bd2b212cf20ee9a6826f193d.zip
Merge remote-tracking branch 'origin/pr/6633'
-rwxr-xr-xmisc/userscripts/qute-pass8
1 files changed, 7 insertions, 1 deletions
diff --git a/misc/userscripts/qute-pass b/misc/userscripts/qute-pass
index 4b3fdae54..76a82e9c3 100755
--- a/misc/userscripts/qute-pass
+++ b/misc/userscripts/qute-pass
@@ -95,6 +95,8 @@ argument_parser.add_argument('--extra-url-suffixes', '-s', default='',
help='Comma-separated string containing extra suffixes (e.g local)')
argument_parser.add_argument('--unfiltered', dest='unfiltered', action='store_true',
help='Show an unfiltered selection of all passwords in the store')
+argument_parser.add_argument('--always-show-selection', dest='always_show_selection', action='store_true',
+ help='Always show selection, even if there is only a single match')
group = argument_parser.add_mutually_exclusive_group()
group.add_argument('--username-only', '-e', action='store_true', help='Only insert username')
group.add_argument('--password-only', '-w', action='store_true', help='Only insert password')
@@ -238,7 +240,11 @@ def main(arguments):
stderr('No pass candidates for URL {!r} found! (I tried {!r})'.format(arguments.url, attempted_targets))
return ExitCodes.NO_PASS_CANDIDATES
- selection = candidates.pop() if len(candidates) == 1 else dmenu(sorted(candidates), arguments.dmenu_invocation)
+ if len(candidates) == 1 and not arguments.always_show_selection:
+ selection = candidates.pop()
+ else:
+ selection = dmenu(sorted(candidates), arguments.dmenu_invocation)
+
# Nothing was selected, simply return
if not selection:
return ExitCodes.SUCCESS