shithub: hell

Download patch

ref: 32487f9b7b2641255273f4be2862429afcc7ea40
parent: 8ee08e84e56e321733b64ba7829ebf8c7ab10ee3
author: penny <penny@limitedideas.org>
date: Mon Nov 3 16:59:51 EST 2025

port /translate for what it's worth

--- a/commands.go
+++ b/commands.go
@@ -718,8 +718,30 @@
 	return cmd
 }
 
+//Untested and undocumtend my intance doesn't do this
+//Don't even have the renderer set up here
+func (hc *Hellclient) translatecmd() cmder {
+	cmd := &basiccmd{}
+	cmd.hc = hc
+	cmd.bname = "translate"
+	cmd.bflags = status | templater
+	cmd.doer = func(data *cmddata) string {
+		line, _ := data.templater.render("$index $display_name $username_full $content $media_descriptions\n$detail_line")
+		return fmt.Sprint(line)
+		translated, err := hc.client.TranslateStatus(context.Background(), data.status.ID)
+			if err != nil {
+				return fmt.Sprintf("Translation error: %s\n", err)
+
+			}
+		hc.PrintObjectProperties(translated)
+		return ""
+	}
+	return cmd
+}
+
 func (hc *Hellclient) newCmdArray() []cmder {
 	cmdarray := []cmder{
+		hc.translatecmd(),
 		hc.catcmd(),
 		hc.replycmd(),
 		hc.rmcmd(),
--- a/main.go
+++ b/main.go
@@ -124,31 +124,6 @@
 
 			//Commands require status indexes
 			switch command {
-			case "cat":
-				if !postOK {
-					fmt.Println("cat: no valid status")
-					return
-				}
-				if index == "" {
-					index = lastindex
-				}
-				line, _ := templater.render("$index $display_name $username_full $content $media_descriptions\n$detail_line")
-				fmt.Print(line)
-				return
-			case "translate":
-				if !postOK {
-					fmt.Println("translate: no valid status")
-					return
-				}
-				if index == "" {
-					index = lastindex
-				}
-				translated, err := client.TranslateStatus(context.Background(), postItem.ID)
-				if err != nil {
-					fmt.Printf("Translation error: %s\n", err)
-					return
-				}
-				hc.PrintObjectProperties(translated)
 			case "like":
 				likefunc := func() {
 					_, err = client.Favourite(context.Background(), postItem.ID)
--