commands

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOpenCmdAndArgs

func GetOpenCmdAndArgs(z *lib.Zettel, path string) (cmd string, args []string)

Types

type CommandRunFunc

type CommandRunFunc func(Env) error

func GetSubcommandAdd

func GetSubcommandAdd(f *flag.FlagSet) CommandRunFunc

func GetSubcommandAutocomplete

func GetSubcommandAutocomplete(f *flag.FlagSet) CommandRunFunc

func GetSubcommandCat added in v0.0.1

func GetSubcommandCat(f *flag.FlagSet) CommandRunFunc

func GetSubcommandClean

func GetSubcommandClean(f *flag.FlagSet) CommandRunFunc

func GetSubcommandEdit

func GetSubcommandEdit(f *flag.FlagSet) CommandRunFunc

func GetSubcommandNew

func GetSubcommandNew(f *flag.FlagSet) CommandRunFunc

func GetSubcommandOpen

func GetSubcommandOpen(f *flag.FlagSet) CommandRunFunc

func GetSubcommandPrint

func GetSubcommandPrint(f *flag.FlagSet) CommandRunFunc

func GetSubcommandRm

func GetSubcommandRm(f *flag.FlagSet) CommandRunFunc

type Env

type Env struct {
	ZettelPath string
}

func GetDefaultEnv

func GetDefaultEnv() (e Env, err error)

func (Env) GetNormalizedPath added in v0.0.1

func (e Env) GetNormalizedPath(a string) (b string, err error)

type NullPutter

type NullPutter struct {
	Channel PutterChannel
}

func (*NullPutter) GetChannel

func (p *NullPutter) GetChannel() PutterChannel

func (*NullPutter) Print

func (p *NullPutter) Print()

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

func MakeProcessor

func MakeProcessor(e Env, files []string, putter Putter) (processor *Processor)

func (*Processor) ActionZettel added in v0.0.1

func (p *Processor) ActionZettel(i int, z *lib.Zettel) (err error)

func (*Processor) HydrateFile added in v0.0.1

func (p *Processor) HydrateFile(i int, path string) (z *lib.Zettel, err error)

func (*Processor) Run

func (p *Processor) Run() (err error)

type ProcessorAction

type ProcessorAction func(i int, z *lib.Zettel) error

type Putter

type Putter interface {
	GetChannel() PutterChannel
	Print()
}

func MakePutter

func MakePutter() (putter Putter)

type PutterChannel

type PutterChannel chan *lib.Zettel

type StdoutPutter

type StdoutPutter struct {
	// contains filtered or unexported fields
}

func (*StdoutPutter) GetChannel

func (p *StdoutPutter) GetChannel() PutterChannel

func (*StdoutPutter) Print

func (p *StdoutPutter) Print()

func (*StdoutPutter) PrintZettel

func (p *StdoutPutter) PrintZettel(z *lib.Zettel)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL