From 29f34289661d072d9381611c15311eb38400fa67 Mon Sep 17 00:00:00 2001
From: Kevin Lyda <kevin@lyda.ie>
Date: Thu, 15 May 2025 19:09:19 +0100
Subject: [PATCH] Add SHOW FLAGS

---
 repl/command.go |  1 +
 repl/show.go    | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/repl/command.go b/repl/command.go
index 8b63bd6..d8292fd 100644
--- a/repl/command.go
+++ b/repl/command.go
@@ -1582,6 +1582,7 @@ folder at the other node is also a SYSTEM folder.
 				Description: `Shows whether BRIEF, NOTIFY, READNEW, or SHOWNEW has been set for the
 currently selected folder.
 `,
+				Action: ActionShowFlags,
 			},
 			"FOLDER": {
 				Description: `Shows information about a folder  of messages. Owner and description are
diff --git a/repl/show.go b/repl/show.go
index 6b23e8f..315f39d 100644
--- a/repl/show.go
+++ b/repl/show.go
@@ -7,11 +7,33 @@ import (
 	"github.com/carlmjohnson/versioninfo"
 
 	"git.lyda.ie/kevin/bulletin/dclish"
+	"git.lyda.ie/kevin/bulletin/this"
 )
 
 // ActionShowFlags handles the `SHOW FLAGS` command.
 func ActionShowFlags(_ *dclish.Command) error {
 	// ctx := storage.Context()
+	flagset := false
+	fmt.Printf("For the selected folder %s:\n", this.Folder.Name)
+	if this.Folder.Notify != 0 {
+		fmt.Println("  NOTIFY is set.")
+		flagset = true
+	}
+	if this.Folder.Readnew != 0 {
+		fmt.Println("  READNEW is set.")
+		flagset = true
+	}
+	if this.Folder.Brief != 0 {
+		fmt.Println("  BRIEF is set.")
+		flagset = true
+	}
+	if this.Folder.Shownew != 0 {
+		fmt.Println("  SHOWNEW is set.")
+		flagset = true
+	}
+	if !flagset {
+		fmt.Println("  No flags are set.")
+	}
 	return nil
 }
 
-- 
GitLab