dstask

package module
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 26 Imported by: 1

README

icon

dstask

Single binary terminal-based TODO manager with git-based sync + markdown notes per task




Dstask is a personal task tracker designed to help you focus. It is similar to Taskwarrior but uses git to synchronise instead of a special protocol.

Features:

Packaging status
  • Powerful context system (automatically applies filter/tags to queries and new tasks)
  • Git powered sync/undo/resolve (passwordstore.org style) which means no need to set up a sync server, and syncing between devices is easy!
  • Task listing won't break with long task text (unlike taskwarrior, currently)
  • note command -- edit a full markdown note for each task. Checklists are useful here.
  • open command -- open URLs found in specified task (including notes) in the browser
  • zsh/bash completion (including tags and projects in current context) for speed
  • A single statically-linked binary
  • import tool which can import GitHub issues or taskwarrior tasks.

Non-features:

  • Collaboration. This is a personal task tracker. Use another system for projects that involve multiple people. Note that it can still be beneficial to use dstask to track what you are working on in the context of a multi-person project tracked elsewhere.

Requirements:

  • Git
  • A 256-color capable terminal

Screenshots

Next command (default when no command is specified)

Show-resolved command to review completed tasks by week. Useful for meetings.

Editing a task with $EDITOR (which happens to be vim)

Adding a task

Sync command (which uses git)

 

Installation

  1. Copy the executable (from the releases page) to somewhere in your path, named dstask and mark it executable. /usr/local/bin/ is suggested.
  2. Enable bash completions by copying source <(dstask bash-completion) into your .bashrc. There's also a zsh-completion subcommand.
  3. Set up an alias in your .bashrc: alias task=dstask or alias t=dstask to make task management slightly faster.
  4. Create or clone a ~/.dstask git repository for the data, if you haven't already: mkdir ~/.dstask && git -C ~/.dstask init.

There are also unofficial packages for:

Moving from Taskwarrior

We have a migration guide to make the transition from taskwarrior to dstask a simple process.

Future of dstask

See etc/FUTURE.md

Usage

Usage: dstask [id...] <cmd> [task summary/filter]

Where [task summary] is text with tags/project/priority specified. Tags are
specified with + (or - for filtering) eg: +work. The project is specified with
a project:g prefix eg: project:dstask -- no quotes. Priorities run from P3
(low), P2 (default) to P1 (high) and P0 (critical). Text can also be specified
for a substring search of description and notes.

Cmd and IDs can be swapped, multiple IDs can be specified for batch
operations.

run "dstask help <cmd>" for command specific help.

Add -- to ignore the current context. / can be used when adding tasks to note
any words after.

Available commands:

next              : Show most important tasks (priority, creation date -- truncated and default)
add               : Add a task
template          : Add a task template
log               : Log a task (already resolved)
start             : Change task status to active
note              : Append to or edit note for a task
stop              : Change task status to pending
done              : Resolve a task
context           : Set global context for task list and new tasks (use "none" to set no context)
modify            : Set attributes for a task
edit              : Edit task with text editor
undo              : Undo last action with git revert
sync              : Pull then push to git repository, automatic merge commit.
open              : Open all URLs found in summary/annotations
git               : Pass a command to git in the repository. Used for push/pull.
remove            : Remove a task (use to remove tasks added by mistake)
show-projects     : List projects with completion status
show-tags         : List tags in use
show-active       : Show tasks that have been started
show-paused       : Show tasks that have been started then stopped
show-open         : Show all non-resolved tasks (without truncation)
show-resolved     : Show resolved tasks
show-templates    : Show task templates
show-unorganised  : Show untagged tasks with no projects (global context)
bash-completion   : Print bash completion script to stdout
zsh-completion    : Print zsh completion script to stdout
help              : Get help on any command or show this message
version           : Show dstask version information

Syntax

Priority

Symbol Name Note
P0 Critical Must be resolved immediately. May appear in all contexts in future.
P1 High
P2 Normal Default priority
P3 Low Shown at bottom and faded.

Operators

Symbol Syntax Description Example
+ +<tag> Include tag. Filter/context, or when adding task. dstask add fix server +work
- -<tag> Exclude tag. Filter/context only. dstask next -feature
-- -- Ignore context. When listing or adding tasks. dstask --, task add -- +home do guttering
/ / When adding a task, everything after will be a note. dstask add check out ipfs / https://ipfs.io
project: project:<project> Set project. Filter/context, or when adding task. dstask context project:dstask
-project: -project:<project> Exclude project, filter/context only. dstask next -project:dstask -work
template: template:<id> Base new task on a template. dstask add template:24

State

State Description
Pending Tasks that have never been started
Active Tasks that have been started
Paused Tasks that have been started but then stopped
Resolved Tasks that have been done/close/completed

Contexts

When dstask runs, a context can be set to filter the task output. Run dstask help context for more examples. There are two ways to set a context.

  1. The context command, which sets a global context on disk.
  2. The DSTASK_CONTEXT environment variable. Contexts set by this environment variable override the global context on disk.

Use the context to set a context that will apply by default, no matter what terminal window you're using.

Use the DSTASK_CONTEXT environment variable to override context in specific uses. For instance, a direnv config can set a context for particular directories.

Context is not synchronised between machines.

Dealing with merge conflicts

Dstask is written in such a way that merge conflicts should not happen, unless a task is edited independently on 2 or more machines without synchronising. In practice this happens rarely; however when it does happen dstask will fail to commit and warn you. You'll then need to go to the underlying ~/.dstask git repository and resolve manually before committing and running dstask sync. In some rare cases the ID can conflict. This is something dstask will soon be equipped to handle automatically when the sync command runs.

Performance

See etc/PERFORMANCE.md

General tips

  • Overwhelmed by tasks? Try focussing by prioritising (set priorities) or narrowing the context. The show-tags and show-projects commands are useful for creating a context.
  • Use dstask to track things you might forget, rather than everything. SNR is important. Don't track tasks for the sake of it, and don't track ideas. Track ideas separately.
  • Spend regular time reviewing tasks. You'll probably find some you've already resolved, and many you've forgotten. The show-unorganised command is good for this.
  • Try to work through tasks from the top of the list. Dstask sorts by priority then creation date -- the most important tasks are at the top.
  • Use start/stop to mark what you're genuinely working on right now; it makes resuming work faster. Paused tasks will be slightly highlighted, so you won't lose track of them. show-paused helps if they start to pile up.
  • Keep a github-style check list in the markdown note of complex or procedural tasks
  • Failing to get started working? Start with the smallest task
  • Record only required tasks. Track ideas separately, else your task list will grow unboundedly! I keep an ideas.md for various projects for this reason.
  • set DSTASK_CONTEXT in a .envrc per-project repository. With direnv, this allows you to automatically switch context

Database

See etc/DATABASE_FORMAT.md

The default database location is ~/.dstask/, but can be configured by the environment variable DSTASK_GIT_REPO.

Alternatives

Alternatives listed must be capable of running in the terminal.

  • TaskLite -- The CLI task manager for power users, written in Haskell
  • Taskwarrior -- the closest analogue
  • Taskbook -- board metaphor, note support
  • todo.txt-cli
  • etm -- event and task manager
  • t -- a minimal todo list with an amusing philosophy

FAQ

Does dstask encrypt tasks?

Encryption is not a design goal of dstask. If you want to have your remote repository encrypted, you may consider git-remote-gcrypt or git-crypt. Note that dstask has not been tested with these tools, nor can any claims be made about the security of the tools themselves.

Is it possible to modify more than one task at once with a filter?

Yes.

  1. Set a context:
  2. Run a modify command without and ID
  3. Hit y to confirm to modify all tasks in context

This means it's natural to review the tasks that would be modified before modifying by listing all tasks in the current context first, instead of potentially operating blindly by matching tags or numbers.

You can also specify multiple task numbers at one time, as with any other command.

Is there a GUI or web interface?

Not as part of dstask itself. However, dstask can be used as a library -- @botto has started developing a web GUI, specifically to allow task management on-the-go via a smartphone: https://github.com/botto/dstask-gui . It's in early stages but is meaningful as having no smartphone-based control is a blocker for a lot of people.

Has dstask been featured in a magazine?

Yes! https://www.linux-magazine.com/Issues/2021/246/dstask :-)

Documentation

Index

Constants

View Source
const (
	STATUS_PENDING   = "pending"
	STATUS_ACTIVE    = "active"
	STATUS_RESOLVED  = "resolved"
	STATUS_DELEGATED = "delegated"
	STATUS_DEFERRED  = "deferred"
	STATUS_PAUSED    = "paused"
	STATUS_RECURRING = "recurring"
	STATUS_TEMPLATE  = "template"

	CMD_NEXT             = "next"
	CMD_ADD              = "add"
	CMD_RM               = "rm"
	CMD_REMOVE           = "remove"
	CMD_TEMPLATE         = "template"
	CMD_LOG              = "log"
	CMD_START            = "start"
	CMD_NOTE             = "note"
	CMD_NOTES            = "notes"
	CMD_STOP             = "stop"
	CMD_DONE             = "done"
	CMD_RESOLVE          = "resolve"
	CMD_CONTEXT          = "context"
	CMD_MODIFY           = "modify"
	CMD_EDIT             = "edit"
	CMD_UNDO             = "undo"
	CMD_SYNC             = "sync"
	CMD_OPEN             = "open"
	CMD_GIT              = "git"
	CMD_SHOW_NEXT        = "show-next"
	CMD_SHOW_PROJECTS    = "show-projects"
	CMD_SHOW_TAGS        = "show-tags"
	CMD_SHOW_ACTIVE      = "show-active"
	CMD_SHOW_PAUSED      = "show-paused"
	CMD_SHOW_OPEN        = "show-open"
	CMD_SHOW_RESOLVED    = "show-resolved"
	CMD_SHOW_TEMPLATES   = "show-templates"
	CMD_SHOW_UNORGANISED = "show-unorganised"
	CMD_COMPLETIONS      = "_completions"
	CMD_HELP             = "help"
	CMD_VERSION          = "version"

	//nolint
	CMD_PRINT_ZSH_COMPLETION = "zsh-completion"
	//nolint
	CMD_PRINT_BASH_COMPLETION = "bash-completion"
	//nolint
	CMD_PRINT_FISH_COMPLETION = "fish-completion"

	// filter: P1 P2 etc
	PRIORITY_CRITICAL = "P0"
	PRIORITY_HIGH     = "P1"
	PRIORITY_NORMAL   = "P2"
	PRIORITY_LOW      = "P3"

	MAX_TASKS_OPEN    = 10000
	TASK_FILENAME_LEN = 40

	// if the terminal is too short, show this many tasks anyway
	MIN_TASKS_SHOWN = 8

	// reserve this many lines for status messages/prompt
	TERMINAL_HEIGHT_MARGIN = 9

	IGNORE_CONTEXT_KEYWORD = "--"
	NOTE_MODE_KEYWORD      = "/"

	// theme loosely based on https://github.com/GothenburgBitFactory/taskwarrior/blob/2.6.0/doc/rc/dark-256.theme
	TABLE_MAX_WIDTH      = 160 // keep it readable
	TABLE_COL_GAP        = 2   // differentiate columns
	MODE_HEADER          = 4
	FG_DEFAULT           = 250
	BG_DEFAULT_1         = 233
	BG_DEFAULT_2         = 232
	MODE_DEFAULT         = 0
	FG_ACTIVE            = 233
	BG_ACTIVE            = 250
	BG_PAUSED            = 236 // task that has been started then stopped
	FG_PRIORITY_CRITICAL = 160
	FG_PRIORITY_HIGH     = 166
	FG_PRIORITY_NORMAL   = FG_DEFAULT
	FG_PRIORITY_LOW      = 245
	FG_NOTE              = 240
)

Variables

View Source
var (
	// for CI testing
	FAKE_PTY = false
	// populated by linker flags, see do-release.sh
	GIT_COMMIT = "Unknown"
	VERSION    = "Unknown"
	BUILD_DATE = "Unknown"
)

for import (etc) it's necessary to have full context

statuses which are hidden by default (direct addressing or show- commands needed to see them)

for most operations, it's not necessary or desirable to load the expensive resolved tasks

incomplete until all statuses are implemented

Functions

func CommandAdd

func CommandAdd(conf Config, ctx, query Query) error

CommandAdd adds a new task to the task database.

func CommandContext

func CommandContext(conf Config, state State, ctx, query Query) error

CommandContext sets a global context for dstask.

func CommandDone

func CommandDone(conf Config, ctx, query Query) error

CommandDone marks a task as done.

func CommandEdit

func CommandEdit(conf Config, ctx, query Query) error

CommandEdit edits a task's metadata, such as status, projects, tags, etc.

func CommandHelp

func CommandHelp(args []string)

CommandHelp prints for a specific command or all commands.

func CommandLog

func CommandLog(conf Config, ctx, query Query) error

CommandLog logs a completed task immediately. Useful for tracking tasks after they're already completed.

func CommandModify

func CommandModify(conf Config, ctx, query Query) error

CommandModify applies a change to tasks specified by ID, or all tasks in current context

func CommandNext

func CommandNext(conf Config, ctx, query Query) error

CommandNext prints the unresolved tasks associated with the current context. This is the default command.

func CommandNote

func CommandNote(conf Config, ctx, query Query) error

CommandNote edits or prints the markdown note associated with the task.

func CommandOpen

func CommandOpen(conf Config, ctx, query Query) error

CommandOpen opens a task URL in the browser, if the task has a URL.

func CommandRemove

func CommandRemove(conf Config, ctx, query Query) error

CommandRemove removes a task by ID from the database.

func CommandShowActive

func CommandShowActive(conf Config, ctx, query Query) error

CommandShowActive prints a list of active tasks.

func CommandShowOpen

func CommandShowOpen(conf Config, ctx, query Query) error

CommandShowOpen prints a list of open tasks without truncation

func CommandShowPaused

func CommandShowPaused(conf Config, ctx, query Query) error

CommandShowPaused prints a list of paused tasks.

func CommandShowProjects

func CommandShowProjects(conf Config, ctx, query Query) error

CommandShowProjects prints a list of projects associated with all tasks. Ignores context/query for valid output

func CommandShowResolved

func CommandShowResolved(conf Config, ctx, query Query) error

CommandShowResolved prints a list of resolved tasks.

func CommandShowTags

func CommandShowTags(conf Config, ctx, query Query) error

CommandShowTags prints a list of all tags associated with non-resolved tasks.

func CommandShowTemplates

func CommandShowTemplates(conf Config, ctx, query Query) error

CommandShowTemplates show a list of task templates.

func CommandShowUnorganised

func CommandShowUnorganised(conf Config, ctx, query Query) error

CommandShowUnorganised prints a list of tasks without tags or projects. no context / query valid

func CommandStart

func CommandStart(conf Config, ctx, query Query) error

CommandStart marks an existing task as started, by ID. If no ID is specified, it creates a new task and starts it.

func CommandStop

func CommandStop(conf Config, ctx, query Query) error

CommandStop marks a task as stopped.

func CommandSync

func CommandSync(repoPath string) error

CommandSync pushes and pulls task database changes from the remote repository.

func CommandTemplate

func CommandTemplate(conf Config, ctx, query Query) error

CommandTemplate creates a new task template.

func CommandUndo

func CommandUndo(conf Config, args []string, ctx, query Query) error

CommandUndo performs undo with git revert.

func CommandVersion

func CommandVersion()

CommandVersion prints version information for the dstask binary.

func ConfirmOrAbort

func ConfirmOrAbort(format string, a ...interface{})

func DeduplicateStrings

func DeduplicateStrings(s []string) []string

func EnsureRepoExists

func EnsureRepoExists(repoPath string)

EnsureRepoExists checks for the existence of a dstask repository, or exits the program.

func ExitFail

func ExitFail(format string, a ...interface{})

func FixStr

func FixStr(text string, width int) string

func GitCommit added in v0.26.0

func GitCommit(repoPath, format string, a ...interface{}) error

GitCommit stages changes in the dstask repository and commits them.

func Help

func Help(cmd string)

func IntSliceContains added in v0.24.1

func IntSliceContains(haystack []int, needle int) bool

generics pls...

func IsValidPriority

func IsValidPriority(priority string) bool

func IsValidStateTransition

func IsValidStateTransition(from string, to string) bool

func IsValidStatus

func IsValidStatus(status string) bool

func IsValidUUID4String

func IsValidUUID4String(str string) bool

func MakeTempFilename added in v0.26.0

func MakeTempFilename(id int, summary, ext string) string

MakeTempFilename encodes the task ID and a truncated portion of a task summary into a string suitable for passing to ioutil.TempFile.

func MustEditBytes

func MustEditBytes(data []byte, tmpFilename string) []byte

func MustGetRepoPath

func MustGetRepoPath(repoPath, directory, file string) string

MustGetRepoPath returns the full path to a file within the dstask git repo. Pass file as an empty string to return the git repo directory itself.

func MustGetTermSize

func MustGetTermSize() (int, int)

func MustGetUUID4String

func MustGetUUID4String() string

func MustGitCommit

func MustGitCommit(repoPath, format string, a ...interface{})

MustGitCommit is like GitCommit, except if any error is encountered, the program exits.

func MustOpenBrowser

func MustOpenBrowser(url string)

func MustRunGitCmd

func MustRunGitCmd(repoPath string, args ...string)

MustRunGitCmd delegates to RunGitCmd and exits the program on any error.

func RunCmd

func RunCmd(name string, args ...string) error

func RunGitCmd

func RunGitCmd(repoPath string, args ...string) error

RunGitCmd shells out to git in the context of the dstask repo.

func StdoutIsTTY

func StdoutIsTTY() bool

func StrSliceContains

func StrSliceContains(haystack []string, needle string) bool

func StrSliceContainsAll

func StrSliceContainsAll(subset, superset []string) bool

func SumInts

func SumInts(vals ...int) int

func Sync

func Sync(repoPath string)

Sync performs a git pull, and then a git push. If any conflicts are encountered, the user will need to resolve them.

func WriteStdout

func WriteStdout(data []byte) error

Types

type Config

type Config struct {
	// Path to the git repository
	Repo string
	// Path to the dstask local state file. State will differ between machines
	StateFile string
	// Path to the ids file
	IDsFile string
	// An unparsed context string, provided via DSTASK_CONTEXT
	CtxFromEnvVar string
}

Config models the dstask application's required configuration. All paths are absolute.

func NewConfig

func NewConfig() Config

NewConfig generates a new Config struct from the environment.

type IdsMap

type IdsMap map[string]int

Persistent DB of UUID -> ID to ensure that tasks have a persistent ID local to this machine for their lifetime. This is important to ensure the correct task is targeted between operations. Historically, each task stored its preferred ID but this resulted in merge conflicts when 2 machines were using dstask concurrently on the same repository.

func LoadIds

func LoadIds(idsFilePath string) IdsMap

func (*IdsMap) Save

func (ids *IdsMap) Save(idsFilePath string)

type Project

type Project struct {
	Name          string `json:"name"`
	Tasks         int    `json:"taskCount"`
	TasksResolved int    `json:"resolvedCount"`
	// if any task is in the active state
	Active bool `json:"active"`
	// first task created
	Created time.Time `json:"created"`
	// last task resolved
	Resolved time.Time `json:"resolved"`

	// highest non-resolved priority within project
	Priority string `json:"priority"`
}

func (*Project) Style

func (p *Project) Style() RowStyle

TODO combine with previous with interface, plus computed Project status

type Query added in v0.24.1

type Query struct {
	Cmd           string
	IDs           []int
	Tags          []string
	AntiTags      []string
	Project       string
	AntiProjects  []string
	Priority      string
	Template      int
	Text          string
	IgnoreContext bool
	// any words after the note operator: /
	Note string
}

when referring to tasks by ID, NON_RESOLVED_STATUSES must be loaded exclusively -- even if the filter is set to show issues that have only some statuses.

func ParseQuery added in v0.24.1

func ParseQuery(args ...string) Query

ParseQuery parses the raw command line typed by the user.

func (Query) HasOperators added in v0.24.1

func (query Query) HasOperators() bool

HasOperators returns true if the query has positive or negative projects/tags, priorities, template

func (*Query) Merge added in v0.24.1

func (query *Query) Merge(q2 Query) Query

Merge applies a context to a new task. Returns new Query, does not mutate.

func (Query) PrintContextDescription added in v0.24.1

func (query Query) PrintContextDescription()

func (Query) String added in v0.24.1

func (query Query) String() string

reconstruct args string

type RowStyle

type RowStyle struct {
	// ansi mode
	Mode int
	// xterm 256-colour palette
	Fg int
	Bg int
}

type SortByDirection

type SortByDirection string
const (
	Ascending  SortByDirection = "ascending"
	Descending SortByDirection = "descending"
)

type State

type State struct {
	// Context is an implicit command line that changes the behavior or display
	// of some commands.
	Context Query
}

State models our local context for serialisation and deserialisation from our state file.

func LoadState

func LoadState(stateFilePath string) State

LoadState reads the state file, if it exists. Otherwise a default State is returned.

func (State) Save

func (state State) Save(stateFilePath string)

Save serialises State to disk as gob binary data.

func (*State) SetContext

func (state *State) SetContext(context Query) error

SetContext sets a context on State, with some validation.

type SubTask

type SubTask struct {
	Summary  string
	Resolved bool
}

type Table

type Table struct {
	Header    []string
	Rows      [][]string
	RowStyles []RowStyle
	Width     int
}

func NewTable

func NewTable(w int, header ...string) *Table

header may havetruncated words

func (*Table) AddRow

func (t *Table) AddRow(row []string, style RowStyle)

func (*Table) Render

func (t *Table) Render()

render table, returning count of rows rendered gap of zero means fit terminal exactly by truncating table -- you will want a larger gap to account for prompt or other text. A gap of -1 means the row count is not limited -- useful for reports or inspecting tasks.

type Task

type Task struct {
	// not stored in file -- rather filename and directory
	UUID   string `json:"uuid" yaml:"-"` // TODO: use actual uuid.UUID type here
	Status string `json:"status" yaml:",omitempty"`
	// is new or has changed. Need to write to disk.
	WritePending bool `json:"-" yaml:"-"`

	// ephemeral, used to address tasks quickly. Non-resolved only. Populated
	// from IDCache or on-the-fly.
	ID int `json:"id" yaml:"-"`

	// Deleted, if true, marks this task for deletion
	Deleted bool `json:"-" yaml:"-"`

	// concise representation of task
	Summary string `json:"summary"`
	// more detail, or information to remember to complete the task
	Notes   string   `json:"notes"`
	Tags    []string `json:"tags"`
	Project string   `json:"project"`
	// see const.go for PRIORITY_ strings
	Priority    string    `json:"priority"`
	DelegatedTo string    `json:"-"`
	Subtasks    []SubTask `json:"-"`
	// uuids of tasks that this task depends on
	// blocked status can be derived.
	// TODO possible filter: :blocked. Also, :overdue
	Dependencies []string `json:"-"`

	Created  time.Time `json:"created"`
	Resolved time.Time `json:"resolved"`
	Due      time.Time `json:"due"`
	// contains filtered or unexported fields
}

Task is our representation of tasks added at the command line and serialized to the task database on disk. It is rendered in multiple ways by the TaskSet to which it belongs.

func (*Task) Display

func (task *Task) Display()

func (Task) Equals added in v0.24.1

func (t Task) Equals(t2 Task) bool

Equals returns whether t2 equals task. for equality, we only consider "core properties", we ignore WritePending, ID, Deleted and filtered

func (*Task) LongSummary

func (t *Task) LongSummary() string

provides Summary + Last note if available

func (*Task) MatchesFilter

func (t *Task) MatchesFilter(query Query) bool

func (*Task) Modify

func (t *Task) Modify(query Query)

func (*Task) Normalise

func (t *Task) Normalise()

Normalise mutates and sorts some of a task object's fields into a consistent format. This should make git diffs more useful.

func (*Task) SaveToDisk

func (t *Task) SaveToDisk(repoPath string)

func (Task) String

func (t Task) String() string

func (*Task) Style

func (t *Task) Style() RowStyle

func (*Task) Validate

func (t *Task) Validate() error

normalise the task before validating!

type TaskSet

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

func LoadTaskSet added in v0.24.1

func LoadTaskSet(repoPath, idsFilePath string, includeResolved bool) (*TaskSet, error)

LoadTaskSet constructs a TaskSet from a repo path..

func (*TaskSet) AllTasks

func (ts *TaskSet) AllTasks() []Task

func (*TaskSet) DisplayByNext

func (ts *TaskSet) DisplayByNext(ctx Query, truncate bool) error

DisplayByNext renders the TaskSet's array of tasks.

func (TaskSet) DisplayByWeek

func (ts TaskSet) DisplayByWeek()

func (TaskSet) DisplayProjects

func (ts TaskSet) DisplayProjects() error

func (*TaskSet) Filter

func (ts *TaskSet) Filter(query Query)

func (*TaskSet) FilterByStatus added in v0.24.1

func (ts *TaskSet) FilterByStatus(status string)

func (*TaskSet) FilterOrganised added in v0.24.1

func (ts *TaskSet) FilterOrganised()

func (*TaskSet) GetByID added in v0.26.0

func (ts *TaskSet) GetByID(id int) (Task, error)

func (*TaskSet) GetProjects

func (ts *TaskSet) GetProjects() []*Project

func (*TaskSet) GetTags

func (ts *TaskSet) GetTags() map[string]bool

func (*TaskSet) LoadTask

func (ts *TaskSet) LoadTask(task Task) (Task, error)

LoadTask adds a task to the TaskSet, but only if it has a new uuid or no uuid. Return annotated task.

func (*TaskSet) MustGetByID

func (ts *TaskSet) MustGetByID(id int) Task

func (*TaskSet) MustLoadTask added in v0.26.0

func (ts *TaskSet) MustLoadTask(task Task) Task

MustLoadTask is the same as LoadTask, except it exits on error.

func (*TaskSet) MustUpdateTask

func (ts *TaskSet) MustUpdateTask(task Task)

TODO maybe this is the place to check for invalid state transitions instead of the main switch statement. Though, a future 3rdparty sync system could need this to work regardless.

func (*TaskSet) NumTotal

func (ts *TaskSet) NumTotal() int

func (*TaskSet) SavePendingChanges

func (ts *TaskSet) SavePendingChanges()

save pending changes to disk TODO return files that have been added/deleted/modified/renamed so they can be passed to git add for performance, instead of doing git add .

func (*TaskSet) SortByCreated added in v0.24.1

func (ts *TaskSet) SortByCreated(dir SortByDirection)

func (*TaskSet) SortByPriority added in v0.24.1

func (ts *TaskSet) SortByPriority(dir SortByDirection)

func (*TaskSet) SortByResolved added in v0.24.1

func (ts *TaskSet) SortByResolved(dir SortByDirection)

func (*TaskSet) Tasks

func (ts *TaskSet) Tasks() []Task

func (*TaskSet) UnHide added in v0.24.1

func (ts *TaskSet) UnHide()

func (*TaskSet) UpdateTask added in v0.26.0

func (ts *TaskSet) UpdateTask(task Task) error

Directories

Path Synopsis
cmd
pkg
imp
imp/tw
Package tw provides utilities for importing tasks from taskwarrior see https://taskwarrior.org/docs/design/task.html Filters can be used in taskwarrior to specify a subset.
Package tw provides utilities for importing tasks from taskwarrior see https://taskwarrior.org/docs/design/task.html Filters can be used in taskwarrior to specify a subset.

Jump to

Keyboard shortcuts

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