summaryrefslogtreecommitdiff
path: root/internal/task/task.go
diff options
context:
space:
mode:
authorPaul Bütow <1224732+snonux@users.noreply.github.com>2025-06-20 09:43:23 +0300
committerGitHub <noreply@github.com>2025-06-20 09:43:23 +0300
commit4c4e186b14b91163beb8316aff6eeda86f9dc171 (patch)
tree512a6b9f8017f8cf0cc24158acc154034c121225 /internal/task/task.go
parent13ec0a6ec615b4c7e7ddc461a7a6a623109826f9 (diff)
parent13f7678a9fd092ac20eec10e4d2196f5bd1ae107 (diff)
Merge pull request #11 from snonux/codex/enhance-taskwarrior-ui-and-functionality
Add cell navigation, editor hotkey, stats and filter
Diffstat (limited to 'internal/task/task.go')
-rw-r--r--internal/task/task.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/task/task.go b/internal/task/task.go
index 4c33fdb..f7a3f73 100644
--- a/internal/task/task.go
+++ b/internal/task/task.go
@@ -46,8 +46,12 @@ func Add(description string, tags []string) error {
// Export retrieves all tasks using `task export rc.json.array=off` and parses
// the JSON output into a slice of Task structs.
-func Export() ([]Task, error) {
- cmd := exec.Command("task", "export", "rc.json.array=off")
+// Export retrieves tasks using `task <filter> export rc.json.array=off` and parses
+// the JSON output into a slice of Task structs. Optional filter arguments are
+// passed directly to the `task` command before `export`.
+func Export(filters ...string) ([]Task, error) {
+ args := append(filters, "export", "rc.json.array=off")
+ cmd := exec.Command("task", args...)
out, err := cmd.Output()
if err != nil {
return nil, err