ref: 64e034333bc1a4e35c778bb4508d1f4be913722c
parent: 1d841d7e15f2a47b5b86f351fb173c0cd61967b8
author: penny <penny@limitedideas.org>
date: Sun Sep 14 16:53:04 EDT 2025
Command not found output
--- a/commands.go
+++ b/commands.go
@@ -6,7 +6,7 @@
var commands = []string{"examine", "reply", "like", "thread", "open", "preview", "download", "dm", "rt", "parent", "children", "rm", "mark", "unmark", "account", "vim", "import", "pause", "resume", "url", "fpost", "ufpost", "edit", "notice"}-func processInput(input string) (command string, arguments string) {+func processInput(input string) (command string, arguments string, found bool) { if input == "" {command = ""
@@ -30,8 +30,13 @@
if strings.HasPrefix(choice, inputcommand) {command = choice
_, arguments, _ = strings.Cut(input, " ")
+ found = true
break
}
+ }
+
+ if command == "" {+ command = inputcommand
}
return
--- a/main.go
+++ b/main.go
@@ -54,7 +54,7 @@
fmt.Println("Error:", err)return
}
- command, arguments := processInput(line)
+ command, arguments, found := processInput(line)
//empty line
if command == "" && arguments == "" {@@ -70,6 +70,11 @@
return
}
+ if !found {+ fmt.Printf("Command not found: \"%s\"\n", command)+ return
+ }
+
hc.lock()
defer hc.unlock()
@@ -337,6 +342,7 @@
hc.dispatchReply(content, postItem.ID, postItem)
return
}
+
}()
}
}
--- a/mastodon.go
+++ b/mastodon.go
@@ -222,7 +222,7 @@
sb.WriteString(fmt.Sprintf("Created %v\n", account.CreatedAt)) sb.WriteString(fmt.Sprintf("Locked: %v\n", account.Locked)) sb.WriteString(fmt.Sprintf("%v\n\n", html2text.HTML2Text(account.Note)))-
+
relationships, err := hc.client.GetAccountRelationships(context.Background(), []string{string(account.ID)})relationship := relationships[0]
if err == nil {@@ -242,7 +242,6 @@
sb.WriteString("Follow request pending\n")}
}
-
return sb.String()
}
--- a/references.go
+++ b/references.go
@@ -1,8 +1,8 @@
package main
import (
- "strings"
"fmt"
+ "strings"
"github.com/mattn/go-mastodon"
)
--- a/status.go
+++ b/status.go
@@ -2,8 +2,8 @@
import (
"context"
- "time"
"fmt"
+ "time"
"github.com/mattn/go-mastodon"
)
@@ -14,7 +14,6 @@
var err error
var statuses []*mastodon.Status
-
for {statusbatch, err := GetTimeline(context.Background(), page)
--
⑨