Unverified Commit 29f34289 authored by Kevin Lyda's avatar Kevin Lyda
Browse files

Add SHOW FLAGS

parent 79925858
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+22 −0
Original line number Diff line number Diff line
@@ -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
}