Skip to content
Snippets Groups Projects
Unverified Commit 29f34289 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Add SHOW FLAGS

parent 79925858
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment