shithub: hell

Download patch

ref: f8ebbc8c488835dad65b9a2c6d7f009d81239c49
parent: 265035f54dcc1d17f0fc450976a0ad5fe344cdc1
author: penny <penny@limitedideas.org>
date: Sun Aug 3 21:39:50 EDT 2025

Hyphenate every format

--- a/main.go
+++ b/main.go
@@ -146,7 +146,7 @@
 				if err != nil {
 					printMastodonErr(err)
 				} else {
-				fmt.Printf(formatUnookmark(postItem, arguments) + "\n")
+				fmt.Printf(formatUnbookmark(postItem, arguments) + "\n")
 				}
 		case "open":
 			url := fmt.Sprintf("%v/statuses/%v", client.Config.Server, postItem.ID)
--- a/mastodon.go
+++ b/mastodon.go
@@ -144,22 +144,22 @@
 // Spaces before prefixes (no space if you're not passing a prefix)
 func formatReblog(post *mastodon.Status, index string) string {
 	reblogString := fmt.Sprintf(" <%v> Reblogged", post.Account.Username)
-	return formatStatusDetailed(post.Reblog, index, reblogString)
+	return hyphenate(formatStatusDetailed(post.Reblog, index, reblogString))
 }
 
 func formatFavorite(post *mastodon.Status, index string) string {
 	favString := fmt.Sprintf("Favorited: %v", index)
-	return formatStatusDetailed(post, "", favString)
+	return hyphenate(formatStatusDetailed(post, "", favString))
 }
 
 func formatBookmark(post *mastodon.Status, index string) string {
 	favString := fmt.Sprintf("Bookmarked: %v", index)
-	return formatStatusDetailed(post, "", favString)
+	return hyphenate(formatStatusDetailed(post, "", favString))
 }
 
-func formatUnookmark(post *mastodon.Status, index string) string {
+func formatUnbookmark(post *mastodon.Status, index string) string {
 	favString := fmt.Sprintf("Unbookmarked: %v", index)
-	return formatStatusDetailed(post, "", favString)
+	return hyphenate(formatStatusDetailed(post, "", favString))
 }
 
 func formatStatus(post *mastodon.Status, index string) string {
@@ -172,7 +172,7 @@
 }
 
 func formatEdit(post *mastodon.Status, index string) string {
-	editString := fmt.Sprintf(" %v EDITED:", post.Account.Username)
+	editString := fmt.Sprintf(" <%v> EDITED:", post.Account.Username)
 	return formatStatusDetailed(post, index, editString)
 }
 
@@ -267,11 +267,13 @@
 
 			case *mastodon.NotificationEvent:
 				if post.Notification.Status == nil {
-					fmt.Printf("Notification [%v] from <%v>\n", post.Notification.Type, post.Notification.Account.Acct)
+					notification := fmt.Sprintf("Notification [%v] from <%v>\n", post.Notification.Type, post.Notification.Account.Acct)
+					fmt.Printf(hyphenate(notification))
 					continue
 				}
 				_, plaintext = RenderPostPlaintext(post.Notification.Status, postref, "")
-				fmt.Printf("Notification [%v] from <%v>: %v\n", post.Notification.Type, post.Notification.Account.Acct, plaintext)
+				notification := fmt.Sprintf("Notification [%v] from <%v>: %v\n", post.Notification.Type, post.Notification.Account.Acct, plaintext)
+				fmt.Printf(hyphenate(notification))
 				saveRef(postMap, post.Notification.Status, postref)
 				postref = IncrementString(postref)
 			default:
--