cmd

package
v0.0.0-...-d0b7c30 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FILE_NAME     = "to-do.json"
	SHOW_TEMPLATE = `
To-do: {{range .Tasks}}
  ● {{.Description}}{{end}}

`
)

Variables

This section is empty.

Functions

func AddCmd

func AddCmd() *cobra.Command

AddCmd prompts the user for a task and adds it to the to-do list

func CompleteCmd

func CompleteCmd() *cobra.Command

CompleteCmd prompts the user to remove a task from the to-do list

func Execute

func Execute()

Execute configures and runs the root command

func IsNonEmpty

func IsNonEmpty(list *work.List) error

IsNonEmpty requires the work list to have elements

func NewSubCmd

func NewSubCmd(
	use string,
	short string,
	load func(string) (*work.List, error),
	validations []Validation,
	process func(*work.List) error,
	save func(string, *work.List) error,
) *cobra.Command

NewSubCmd generates a subcommand that loads, processes, and saves a list

func ShowCmd

func ShowCmd() *cobra.Command

ShowCmd prints the to-do list

Types

type Validation

type Validation func(list *work.List) error

Validation defines the function that validates a list

Jump to

Keyboard shortcuts

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