diff --git a/repl/command.go b/repl/command.go index 8b63bd69d5462ffebdf622a5a9ff7a91e4b715e1..d8292fd673ecd1038621b08ec82dc4f067c20093 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 6b23e8fce6ba017576caacaf9e9d80561f8d95c8..315f39d51a3539354500e39e2148d92c26c79fe3 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 }