From 13c7205fc728858c9a41e24bb40540da6fdbbe3a Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Fri, 19 Apr 2024 21:30:17 +0200 Subject: [PATCH] Return entry if selection is unique --- entries.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/entries.go b/entries.go index 6e563ca..2a4c287 100644 --- a/entries.go +++ b/entries.go @@ -62,6 +62,10 @@ func readEntry(selection string, g *gokeepasslib.Group) (*gokeepasslib.Entry, er return nil, fmt.Errorf("No entry found") } + if len(entries) == 1 { + return readEntry(entries[0], g) + } + for i, entry := range entries { fmt.Printf("%3d %s\n", i, entry) }