Skip to content

Commit bc994a0

Browse files
author
Anand
committed
Enable clipboard copy for finding entries if single entry result
1 parent ab86f13 commit bc994a0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

actions.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,12 @@ func findCurrentEntry(term string) error {
432432
return err
433433
} else {
434434
var delim bool
435+
var pcopy bool
435436

436437
if len(entries) == 1 {
437438
delim = true
439+
pcopy = true
440+
// Single entry means copy password can be enabled
438441
} else {
439442
_, settings := getOrCreateLocalConfig(APP)
440443
fmt.Printf("%s", getColor(strings.ToLower(settings.Color)))
@@ -444,6 +447,11 @@ func findCurrentEntry(term string) error {
444447
for _, entry := range entries {
445448
printEntry(&entry, delim)
446449
}
450+
451+
if pcopy {
452+
// Single entry
453+
copyPasswordToClipboard(entries[0].Password)
454+
}
447455
}
448456

449457
return err

0 commit comments

Comments
 (0)