From 5b11763ccff8ced508dbbeba0cd14a7eb712c653 Mon Sep 17 00:00:00 2001 From: Guillermo Gonzalez Date: Fri, 1 Apr 2022 14:51:49 -0300 Subject: [PATCH] If there is a single item for a url, use it instead of prompting --- qute_1pass.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qute_1pass.py b/qute_1pass.py index 5ed9737..e6fb2a8 100755 --- a/qute_1pass.py +++ b/qute_1pass.py @@ -223,9 +223,13 @@ class OnePass: raise cls.NoItemsFoundError(f"No items found for host {host}") try: - credential = pipe_commands( - ["echo", "\n".join(mapping.keys())], CMD_ITEM_SELECT - ) + # if there is a single item, use that instead of prompting + if len(mapping) == 1: + credential = list(mapping.keys())[0] + else: + credential = pipe_commands( + ["echo", "\n".join(mapping.keys())], CMD_ITEM_SELECT + ) except ExecuteError: pass