Replace entry reader with copy menu in most cases

This commit is contained in:
2025-11-23 14:49:49 -05:00
parent b26c2ce17c
commit 8112496006
6 changed files with 74 additions and 76 deletions
+1 -5
View File
@@ -2,7 +2,6 @@ package cli
import (
"fmt"
"os"
"github.com/rwinkhart/go-boilerplate/back"
"github.com/rwinkhart/go-boilerplate/front"
@@ -29,17 +28,14 @@ func inputPasswordGen() string {
}
// writeEntryCLI writes an entry to realPath and previews it (errors if no data is supplied).
func writeEntryCLI(realPath string, decSlice []string, hideSecrets bool, passwordIsNew bool, oldPassword string) {
func writeEntryCLI(realPath string, decSlice []string, passwordIsNew bool, oldPassword string) {
if core.EntryIsNotEmpty(decSlice) {
err := core.WriteEntry(realPath, decSlice, passwordIsNew)
if err != nil {
other.PrintError("Failed to write entry: "+err.Error(), back.ErrorWrite)
}
// preview the entry
fmt.Println(back.AnsiBold + "\nEntry Preview:" + back.AnsiReset)
EntryReader(decSlice, hideSecrets, true)
CopyMenu("", decSlice, oldPassword)
os.Exit(0)
} else {
other.PrintError("No data supplied for entry", back.ErrorTargetNotFound)
}