diff --git a/go.mod b/go.mod index 1af7390..8f48faa 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,11 @@ module github.com/rwinkhart/MUTN -go 1.25.5 +go 1.25.6 require ( github.com/charmbracelet/glamour v0.7.0 github.com/rwinkhart/go-boilerplate v0.2.2 - github.com/rwinkhart/libmutton v0.4.3-0.20260109040506-4467a8c7421b + github.com/rwinkhart/libmutton v0.4.3-0.20260121234916-409db78d836b golang.org/x/term v0.38.0 ) diff --git a/go.sum b/go.sum index 39a7399..6300388 100644 --- a/go.sum +++ b/go.sum @@ -48,8 +48,8 @@ github.com/rwinkhart/go-highlite v0.1.1 h1:9TxbRhYVfD/3YaEgNk1BtEiZ0t8/5mxDUZqNM github.com/rwinkhart/go-highlite v0.1.1/go.mod h1:mWLMtCWcyV0BG4NeyPyAUGMjPvI0ds6vXmUq89QwBFA= github.com/rwinkhart/go-winio v0.1.0 h1:b72agLW+dETGmhR3VbcbwnStfgKfc5AfgJOXBJDkaHg= github.com/rwinkhart/go-winio v0.1.0/go.mod h1:ZWa7ssZJT30CCDGJ7fk/2SBTq9BIQrrVjrcss0UW2s0= -github.com/rwinkhart/libmutton v0.4.3-0.20260109040506-4467a8c7421b h1:ZHOGUddwoUEGC+7eUl+GvOde3S8UjQqddKv2TERTk1k= -github.com/rwinkhart/libmutton v0.4.3-0.20260109040506-4467a8c7421b/go.mod h1:qInUv19lzX1adFNI6Ih/IEVy+pktSTh/yA7cRTdVPH8= +github.com/rwinkhart/libmutton v0.4.3-0.20260121234916-409db78d836b h1:aG/6pb3bumQhdAE0oyjlOeiUujMoRq6509HYWmcMBCs= +github.com/rwinkhart/libmutton v0.4.3-0.20260121234916-409db78d836b/go.mod h1:++8vRtgE/9oAtYHlMISk6aE9ijzZleiy6d82Z7NhQ/0= github.com/rwinkhart/peercred-mini v0.1.2 h1:4cGWDbv0whvLeVvbUdx84V/9p+2fS+DEXgrA1KxlRFo= github.com/rwinkhart/peercred-mini v0.1.2/go.mod h1:LLHG7YshHEpbpJJP+Il9nx2dnGj5O3VGE32rWmflj0c= github.com/rwinkhart/rcw v0.2.4 h1:FrRSsl+ui1WLmDwqjLSROtFPKqSeGLEfF2SPENt4qP0= diff --git a/mutn.go b/mutn.go index d53971c..86e20f1 100644 --- a/mutn.go +++ b/mutn.go @@ -48,7 +48,7 @@ func main() { case "show", "-s": cli.EntryReaderDecrypt(realPath, false) case "copy": - if err := clip.CopyShortcut(realPath, 0); err != nil { + if err := clip.CopyShortcut(realPath, 0, nil); err != nil { other.PrintError("Failed to copy password to clipboard: "+err.Error(), global.ErrorClipboard) } case "edit": @@ -98,7 +98,7 @@ func main() { default: cli.HelpCopy() } - if err := clip.CopyShortcut(realPath, field); err != nil { + if err := clip.CopyShortcut(realPath, field, nil); err != nil { other.PrintError("Failed to copy field to clipboard: "+err.Error(), global.ErrorClipboard) } case "edit": @@ -226,7 +226,7 @@ func main() { case 3: forceReage := front.InputBinary("Re-age aged entries?") fmt.Println("Aging entries; this may take awhile - do not terminate this process") - if err := age.AllPasswordEntries(forceReage); err != nil { + if err := age.AllPasswordEntries(forceReage, nil); err != nil { other.PrintError("Failed to age entries: "+err.Error(), 1) } case 4: diff --git a/src/cli/copyMenu.go b/src/cli/copyMenu.go index 81f0063..1b49401 100644 --- a/src/cli/copyMenu.go +++ b/src/cli/copyMenu.go @@ -26,7 +26,7 @@ func CopyMenu(vanityPath string, decSlice []string, oldPassword string) { var err error if decSlice == nil { // decrypt entry - decSlice, err = crypt.DecryptFileToSlice(realPath) + decSlice, err = crypt.DecryptFileToSlice(realPath, nil) if err != nil { other.PrintError("Failed to decrypt entry: "+err.Error(), global.ErrorDecryption) } diff --git a/src/cli/edit.go b/src/cli/edit.go index 1c6a345..f18105e 100644 --- a/src/cli/edit.go +++ b/src/cli/edit.go @@ -28,7 +28,7 @@ func RenameCli(oldVanityPath string) { // EditEntryField edits a field of an entry at realPath (user input). func EditEntryField(realPath string, field int) { // fetch old entry data (with all required lines present) - decSlice, err := core.GetOldEntryData(realPath, field) + decSlice, err := core.GetOldEntryData(realPath, field, nil) if err != nil { other.PrintError("Failed to fetch entry data: "+err.Error(), back.ErrorRead) } @@ -69,7 +69,7 @@ func EditEntryField(realPath string, field int) { // GenUpdate generates a new password for an entry at realPath (user input). func GenUpdate(realPath string) { // fetch old entry data - decSlice, err := core.GetOldEntryData(realPath, 0) + decSlice, err := core.GetOldEntryData(realPath, 0, nil) if err != nil { other.PrintError("Failed to fetch entry data: "+err.Error(), back.ErrorRead) } diff --git a/src/cli/entryReader.go b/src/cli/entryReader.go index 2f78db9..3ef3b3c 100644 --- a/src/cli/entryReader.go +++ b/src/cli/entryReader.go @@ -72,7 +72,7 @@ func EntryReaderDecrypt(realPath string, hideSecrets bool) { if err != nil { // if the location does not exist or is a directory... other.PrintError("Failed to verify target location: "+err.Error(), back.ErrorTargetNotFound) } - decSlice, err := crypt.DecryptFileToSlice(realPath) + decSlice, err := crypt.DecryptFileToSlice(realPath, nil) if err != nil { other.PrintError("Failed to decrypt entry: "+err.Error(), global.ErrorDecryption) } diff --git a/src/cli/utilitiesMisc.go b/src/cli/utilitiesMisc.go index a912385..ffe070d 100644 --- a/src/cli/utilitiesMisc.go +++ b/src/cli/utilitiesMisc.go @@ -30,7 +30,7 @@ func inputPasswordGen() string { // writeEntryCLI writes an entry to realPath and previews it (errors if no data is supplied). func writeEntryCLI(realPath string, decSlice []string, passwordIsNew bool, oldPassword string) { if core.EntryIsNotEmpty(decSlice) { - if err := core.WriteEntry(realPath, decSlice, passwordIsNew); err != nil { + if err := core.WriteEntry(realPath, decSlice, passwordIsNew, nil); err != nil { other.PrintError("Failed to write entry: "+err.Error(), back.ErrorWrite) } // preview the entry