Skip to content
Snippets Groups Projects
Select Git revision
  • a6c9dc49e9e9749b7dd3b659934193ca61eccae9
  • 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

PACKAGING.md

Blame
  • set.go 4.90 KiB
    // Package repl implements the main event loop.
    package repl
    
    import (
    	"errors"
    	"fmt"
    	"strings"
    
    	"git.lyda.ie/kevin/bulletin/dclish"
    	"git.lyda.ie/kevin/bulletin/folders"
    	"git.lyda.ie/kevin/bulletin/this"
    )
    
    // ActionSetAccess handles the `SET ACCESS` command.
    func ActionSetAccess(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionSetAccess.")
    	return nil
    }
    
    // ActionSetAlways handles the `SET ALWAYS` command.
    func ActionSetAlways(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionSetAlways.")
    	return nil
    }
    
    // ActionSetNoalways handles the `SET NOALWAYS` command.
    func ActionSetNoalways(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionSetNoalways.")
    	return nil
    }
    
    // ActionSetBrief handles the `SET BRIEF` command.
    func ActionSetBrief(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionSetBrief.")
    	return nil
    }
    
    // ActionSetNobrief handles the `SET NOBRIEF` command.
    func ActionSetNobrief(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionSetNobrief.")
    	return nil
    }
    
    // ActionSetDefaultExpire handles the `SET DEFAULT_EXPIRE` command.
    func ActionSetDefaultExpire(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionSetDefaultExpire.")
    	return nil
    }
    
    // ActionSetExpireLimit handles the `SET EXPIRE_LIMIT` command.
    func ActionSetExpireLimit(_ *dclish.Command) error {
    	fmt.Println("TODO: implement ActionSetExpireLimit.")
    	return nil
    }
    
    // ActionSetFolder handles the `SET FOLDER` command.  This selects a folder.
    func ActionSetFolder(cmd *dclish.Command) error {
    	if len(cmd.Args) != 1 {
    		return errors.New("TODO: need to add code for /MARK")
    	}
    	// TODO: Move shared code here and in ActionSelect and ActionDirectory into a function.
    	if strings.Contains(cmd.Args[0], "%") {
    		return errors.New("Folder name cannot contain a %")
    	}
    	folder := folders.FindFolder(cmd.Args[0])
    	if folder.Name == "" {
    		return errors.New("Unable to select the folder")
    	}
    	if folders.IsFolderAccess(folder.Name, this.User.Login) {
    		this.Folder = folder