Skip to content
Snippets Groups Projects
Select Git revision
  • 3eab75328058de36699962ce32a1962c142f100b
  • master default protected
  • commit-alias
  • editor-modeline
  • commit-abbreviation
  • make-hooks-work-as-advertised
  • lyda-home-version
  • feature-aliases
  • git-version-bsd-fix
  • hook-changes
  • v1.20151229-1
  • v1.20151229
  • v1.20150502-1
  • v1.20150502
  • v1.20141026-manpage-static
  • v1.20141026-1
  • v1.20141026
  • v1.20141025-1
  • v1.20141025
  • v1.20141009-manpage-static
  • v1.20141009-1
  • v1.20141009
  • v1.20140508-1-bpo70+1
  • v1.20140508-1
  • v1.20140508-manpage-static
  • v1.20140508
  • v1.20140507
  • v1.20140313
  • v1.20131229-homebrew
  • v1.20131229-1-bpo60+1
30 results

AUTHORS

Blame
  • show.go 1.78 KiB
    // Package repl implements the main event loop.
    package repl
    
    import (
    	"fmt"
    
    	"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
    }
    
    // ActionShowFolder handles the `SHOW FOLDER` command.
    func ActionShowFolder(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionShowFolder.")
    	return nil
    }
    
    // ActionShowNew handles the `SHOW NEW` command.
    func ActionShowNew(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionShowNew.")
    	return nil
    }
    
    // ActionShowPrivileges handles the `SHOW PRIVILEGES` command.
    func ActionShowPrivileges(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionShowPrivileges.")
    	return nil
    }
    
    // ActionShowUser handles the `SHOW USER` command.
    func ActionShowUser(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionShowUser.")
    	return nil
    }
    
    // ActionShowVersion handles the `SHOW VERSION` command.
    func ActionShowVersion(_ *dclish.Command) error {
    	rev := versioninfo.Revision
    	if len(rev) > 7 {
    		rev = rev[len(rev)-7:]
    	}
    	fmt.Printf("BULLETIN Version 2.0.7g (%s)\n", rev)