edit

package
v0.0.0-...-8667993 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Overview

Package edit contains sub commands for editing books from the command line.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownCommand = errors.New("unknown command")

ErrUnknownCommand is returned when a command cannot be found by the given command name.

Functions

This section is empty.

Types

type DefaultCommand

type DefaultCommand struct {
	Run  func(cmd *DefaultCommand, args string)
	RunE func(cmd *DefaultCommand, args string) error
	Help string
	// contains filtered or unexported fields
}

DefaultCommand contains fields used by all other edit commands.

type Parser

type Parser struct {
	OutputTemplate *template.Template
	// contains filtered or unexported fields
}

Parser contains the set of available commands, and the shared state for those commands.

func NewParser

func NewParser(book *books.Book, lib *books.Library, tmpl *template.Template) *Parser

NewParser creates a new parser.

func (*Parser) Completer

func (p *Parser) Completer(s string) []string

Completer tries to complete a command and its arguments.

func (*Parser) RunCommand

func (p *Parser) RunCommand(cmd string, args string) error

RunCommand runs a command with the given arguments, returning ErrUnknownCommand if not found.

Jump to

Keyboard shortcuts

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