shithub: hell

Download patch

ref: 2e100723bde5eb24ab032f4783478108685b30e7
parent: 019f299aef5dbd1c3d9901f20f8b14bbc9d171c1
author: penny <penny@limitedideas.org>
date: Mon Nov 3 14:24:42 EST 2025

add acc_resolve flag to trigger @username@domain lookup so commands don't need to do it

--- a/commands.go
+++ b/commands.go
@@ -103,6 +103,7 @@
 	status
 	account
 	argument
+	acc_resolve
 )
 
 type cmdloader struct {
@@ -156,6 +157,11 @@
 	if !data.cmd_found {
 		return "", fmt.Errorf("Command %s not found.\n", data.command)
 	}
+	flags := loader.cmdmap[data.command].flags()
+	if flags&acc_resolve != 0 {
+		data.status = nil
+		data.account = data.lookupAccount(loader)
+	}
 	return loader.cmdmap[data.command].result(data), nil
 }
 
@@ -303,12 +309,12 @@
 }
 
 func (cmd *profilecmd) flags() cmdflag {
-	return free
+	return free | acc_resolve
 }
 
 func (cmd *profilecmd) result(data *cmddata) string {
 	hc := cmd.Hellclient
-	account := data.lookupAccount(cmd.cmdloader)
+	account := data.account
 	if account == nil {
 		return fmt.Sprintf("Account lookup failed.\n")
 	}
--- a/main.go
+++ b/main.go
@@ -124,9 +124,6 @@
 
 			//Contextual commands that need to handle their own requirements
 			switch command {
-			case "resume":
-				hc.pause(false)
-				return
 			case "rm":
 				if !foundindex && *recentpost != nil {
 					deletefunc := func(job *GenericJob) {
@@ -189,10 +186,6 @@
 				fmt.Print(hc.page.String())
 				hc.pause(true)
 				return
-			}
-
-			//Commands that don't take an index
-			switch command {
 			}
 
 			//Commands that accept debug indexes
--