cli

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Add = cmd.Sub{
	Name:  "add",
	Alias: "+",
	Short: "Add new task",
	Args:  &AddArgs{},
	Run:   AddRun,
}

Add a new task

View Source
var All = cmd.Sub{
	Name:  "all",
	Short: "Print all tasks",
	Flags: &AllFlags{},
	Run:   AllRun,
}

All prints a list of every task, regardless of status

View Source
var Backlog = cmd.Sub{
	Name:  "backlog",
	Alias: "log",
	Short: "Print current Backlog list",
	Flags: &BacklogFlags{},
	Run:   BacklogRun,
}

Backlog prints the tasks in the backlog

View Source
var Claim = cmd.Sub{
	Name:  "claim",
	Alias: "^",
	Short: "Move a task from the Backlog to TODO",
	Args:  &ClaimArgs{},
	Run:   ClaimRun,
}

Claim moves a task from the Backlog to the TODO list

View Source
var Color = cmd.Sub{
	Name:  "color",
	Short: "Set color for project or label",
	Args:  &ColorArgs{},
	Run:   ColorRun,
}

Color a new task

View Source
var Colors = cmd.Sub{
	Name:  "colors",
	Short: "List available colors",
	Run:   ColorsRun,
}

Colors prints the supported color codes

View Source
var Completed = cmd.Sub{
	Name:  "completed",
	Short: "Print current Completed list",
	Flags: &CompletedFlags{},
	Run:   CompletedRun,
}

Completed prints the completed tasks

View Source
var Done = cmd.Sub{
	Name:  "done",
	Alias: "!",
	Short: "Mark task done",
	Args:  &DoneArgs{},
	Run:   DoneRun,
}

Done marks a task as completed

View Source
var Init = cmd.Sub{
	Name:  "init",
	Short: "Create todo list in the current directory",
	Run:   InitRun,
}

Init a new task

View Source
var List = cmd.Sub{
	Name:  "list",
	Alias: "ls",
	Short: "Print current TODO list",
	Flags: &ListFlags{},
	Run:   ListRun,
}

List prints the TODO list

View Source
var Modify = cmd.Sub{
	Name:  "modify",
	Alias: "mod",
	Short: "Modify an existing task",
	Args:  &ModifyArgs{},
	Run:   ModifyRun,
}

Modify deletes a task permanently

View Source
var Remove = cmd.Sub{
	Name:  "remove",
	Short: "Remove a task entirely",
	Args:  &RemoveArgs{},
	Run:   RemoveRun,
}

Remove deletes a task permanently

View Source
var Report = cmd.Sub{
	Name:  "report",
	Short: "Generate TODO.md summary of all tasks",
	Run:   ReportRun,
}

Report prints a list of every task, regardless of status

View Source
var ResetCompleted = cmd.Sub{
	Name:  "reset-completed",
	Short: "Remove all Completed tasks",
	Run:   ResetCompletedRun,
}

ResetCompleted permanently removes all completed tasks

View Source
var Return = cmd.Sub{
	Name:  "return",
	Alias: ".",
	Short: "Return a task to the Backlog from TODO",
	Args:  &ReturnArgs{},
	Run:   ReturnRun,
}

Return moves a task from the TODO list to the backlog

View Source
var Root = cmd.Root{
	Name:  "todo",
	Short: "A simple text-based task manager, writter in Go",
}

Root forms the basis of this application

View Source
var Undo = cmd.Sub{
	Name:  "undo",
	Short: "Move a task from Completed to Backlog",
	Args:  &UndoArgs{},
	Run:   UndoRun,
}

Undo moves a task from the TODO list to the backlog

Functions

func AddRun

func AddRun(r *cmd.Root, s *cmd.Sub)

AddRun carries out the "add" sub-command

func AllRun

func AllRun(r *cmd.Root, s *cmd.Sub)

AllRun carries out the "all" sub-command

func BacklogRun

func BacklogRun(r *cmd.Root, s *cmd.Sub)

BacklogRun carries out the "backlog" sub-command

func ClaimRun

func ClaimRun(r *cmd.Root, s *cmd.Sub)

ClaimRun carries out the "claim" sub-command

func ColorRun

func ColorRun(r *cmd.Root, s *cmd.Sub)

ColorRun carries out the "add" sub-command

func ColorsRun

func ColorsRun(r *cmd.Root, s *cmd.Sub)

ColorsRun carries out the "colors" sub-command

func CompletedRun

func CompletedRun(r *cmd.Root, s *cmd.Sub)

CompletedRun carries out the "completed" sub-command

func DoneRun

func DoneRun(r *cmd.Root, s *cmd.Sub)

DoneRun carries out the "done" sub-command

func InitRun

func InitRun(r *cmd.Root, s *cmd.Sub)

InitRun carries out the "init" sub-command

func ListRun

func ListRun(r *cmd.Root, s *cmd.Sub)

ListRun carries out the "list" sub-command

func ModifyRun

func ModifyRun(r *cmd.Root, s *cmd.Sub)

ModifyRun carries out the "modify" sub-command

func RemoveRun

func RemoveRun(r *cmd.Root, s *cmd.Sub)

RemoveRun carries out the "remove" sub-command

func ReportRun

func ReportRun(r *cmd.Root, s *cmd.Sub)

ReportRun carries out the "report" sub-command

func ResetCompletedRun

func ResetCompletedRun(r *cmd.Root, s *cmd.Sub)

ResetCompletedRun carries out the "reset-completed" sub-command

func ReturnRun

func ReturnRun(r *cmd.Root, s *cmd.Sub)

ReturnRun carries out the "return" sub-command

func UndoRun

func UndoRun(r *cmd.Root, s *cmd.Sub)

UndoRun carries out the "undo" sub-command

Types

type AddArgs

type AddArgs struct {
	Spec []string `desc:"Specification for a new task (e.g. @project :label \"New Task\")"`
}

AddArgs accepts a new task specification

type AllFlags

type AllFlags struct {
	Project  string `short:"p" long:"project" desc:"Name of project to filter on"`
	Label    string `short:"l" long:"label" desc:"Name of label to fiter on"`
	FullTime bool   `short:"T" long:"full-time" desc:"Print both date and time for all tasks"`
}

AllFlags contains the flags for the "all" sub-command

type BacklogFlags

type BacklogFlags struct {
	Project  string `short:"p" long:"project" desc:"Name of project to filter on"`
	Label    string `short:"l" long:"label" desc:"Name of label to fiter on"`
	FullTime bool   `short:"T" long:"full-time" desc:"Print both date and time for all tasks"`
}

BacklogFlags contains the flags for the "backlog" sub-command

type ClaimArgs

type ClaimArgs struct {
	IDs []uint `desc:"ID(s) of Task(s) to claim as TODO"`
}

ClaimArgs specifies the ID of the task to claim

type ColorArgs

type ColorArgs struct {
	Spec string `desc:"specification for a project or label (e.g. @project or :label "`
	Name string `desc:"name of color"`
}

ColorArgs accepts a color specification

type CompletedFlags

type CompletedFlags struct {
	Project  string `short:"p" long:"project" desc:"Name of project to filter on"`
	Label    string `short:"l" long:"label" desc:"Name of label to fiter on"`
	FullTime bool   `short:"T" long:"full-time" desc:"Print both date and time for all tasks"`
}

CompletedFlags contains the flags for the "completed" sub-command

type DoneArgs

type DoneArgs struct {
	IDs []uint `desc:"ID(s) of Task(s) to mark as done"`
}

DoneArgs specifies the ID of the task to mark done

type ListFlags

type ListFlags struct {
	Project  string `short:"p" long:"project" desc:"Name of project to filter on"`
	Label    string `short:"l" long:"label" desc:"Name of label to fiter on"`
	FullTime bool   `short:"T" long:"full-time" desc:"Print both date and time for all tasks"`
}

ListFlags contains the flags for the "list" sub-command

type ModifyArgs

type ModifyArgs struct {
	ID   uint     `desc:"ID of Task to modify"`
	Spec []string `desc:"Specification for modifying the task (e.g. @new_project :new_label \"New Name\")"`
}

ModifyArgs specifies the ID of the task to modify

type RemoveArgs

type RemoveArgs struct {
	IDs []uint `desc:"ID(s) of Task(s) to remove"`
}

RemoveArgs specifies the ID of the task to remove

type ReturnArgs

type ReturnArgs struct {
	IDs []uint `desc:"ID(s) of Task(s) to return"`
}

ReturnArgs specifies the ID of the task to return

type UndoArgs

type UndoArgs struct {
	IDs []uint `desc:"ID(s) of Task(s) to undo"`
}

UndoArgs specifies the ID of the task to undo

Jump to

Keyboard shortcuts

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