Bump libmutton/go-boilerplate

This commit is contained in:
2025-06-01 17:04:27 -04:00
parent 9201e3857c
commit bdaaf0906c
8 changed files with 29 additions and 29 deletions
+11 -11
View File
@@ -48,7 +48,7 @@ func main() {
case "copy":
err := core.CopyArgument(targetLocation, 0)
if err != nil {
other.PrintError("Failed to copy passphrase to clipboard: "+err.Error(), global.ErrorClipboard, true)
other.PrintError("Failed to copy passphrase to clipboard: "+err.Error(), global.ErrorClipboard)
}
case "edit":
cli.EditEntryField(targetLocation, true, 0)
@@ -59,7 +59,7 @@ func main() {
case "shear":
err := syncclient.ShearRemoteFromClient(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory
if err != nil {
other.PrintError("Failed to shear target: "+err.Error(), back.ErrorWrite, true)
other.PrintError("Failed to shear target: "+err.Error(), back.ErrorWrite)
}
default:
cli.HelpMain()
@@ -98,7 +98,7 @@ func main() {
}
err := core.CopyArgument(targetLocation, field)
if err != nil {
other.PrintError("Failed to copy field to clipboard: "+err.Error(), global.ErrorClipboard, true)
other.PrintError("Failed to copy field to clipboard: "+err.Error(), global.ErrorClipboard)
}
case "edit":
var field int // indicates which (numbered) field to edit
@@ -116,7 +116,7 @@ func main() {
case "rename", "-r":
isAccessible, _ := back.TargetIsFile(targetLocation, true) // error is ignored because dir/file status is irrelevant
if !isAccessible {
other.PrintError("Failed to access location ("+targetLocation+")", back.ErrorTargetNotFound, true)
other.PrintError("Failed to access location ("+targetLocation+")", back.ErrorTargetNotFound)
}
cli.RenameCli(args[1]) // pass the incomplete path as the server and all clients (reading from the deletions directory) will have a different home directory
default:
@@ -167,7 +167,7 @@ func main() {
case "folder", "-f":
err := syncclient.AddFolderRemoteFromClient(args[1]) // pass the incomplete path as the server will have a different home directory
if err != nil {
other.PrintError("Failed to add folder: "+err.Error(), back.ErrorWrite, true)
other.PrintError("Failed to add folder: "+err.Error(), back.ErrorWrite)
}
default:
cli.HelpAdd()
@@ -183,21 +183,21 @@ func main() {
case "clipclear":
err := core.ClipClearArgument()
if err != nil {
other.PrintError("Failure occurred in clipboard clearing process: "+err.Error(), global.ErrorClipboard, true)
other.PrintError("Failure occurred in clipboard clearing process: "+err.Error(), global.ErrorClipboard)
}
case "startrcwd":
crypt.RCWDArgument()
case "sync":
_, err := syncclient.RunJob(true)
if err != nil {
other.PrintError("Failed to sync entries: "+err.Error(), global.ErrorSyncProcess, true)
other.PrintError("Failed to sync entries: "+err.Error(), global.ErrorSyncProcess)
}
case "init":
err := core.LibmuttonInit(front.Input,
[][3]string{{"MUTN", "textEditor", cmp.Or(front.Input("Text editor (leave blank for $EDITOR, falls back to \""+cli.FallbackEditor+"\"):"), os.Getenv("EDITOR"), cli.FallbackEditor)}},
confirmRCWPassphrase("new"), false)
if err != nil {
other.PrintError("Initialization failed: "+err.Error(), 0, true)
other.PrintError("Initialization failed: "+err.Error(), 0)
}
case "tweak":
choice := front.InputMenuGen("Action:", []string{"Change device ID", "Change master passphrase/Optimize entries"})
@@ -205,11 +205,11 @@ func main() {
case 1:
oldDeviceID, err := global.GetCurrentDeviceID()
if err != nil {
other.PrintError("Failed to get current device ID: "+err.Error(), back.ErrorRead, true)
other.PrintError("Failed to get current device ID: "+err.Error(), back.ErrorRead)
}
_, _, err = synccycles.DeviceIDGen(oldDeviceID)
if err != nil {
other.PrintError("Failed to change device ID: "+err.Error(), global.ErrorSyncProcess, true)
other.PrintError("Failed to change device ID: "+err.Error(), global.ErrorSyncProcess)
}
fmt.Println("\nDevice ID changed successfully.")
case 2:
@@ -218,7 +218,7 @@ func main() {
fmt.Print("\nRe-encrypting entries. Please wait; do not force close this process.\n")
err := core.EntryRefresh(oldPassphrase, newPassphrase, false)
if err != nil {
other.PrintError("Re-encryption failed: "+err.Error(), global.ErrorEncryption, true)
other.PrintError("Re-encryption failed: "+err.Error(), global.ErrorEncryption)
}
fmt.Println("\nRe-encryption complete.")
}