feat: add due date filters for list command

- --due: show only nodes with a due date set
- --due-within N: show only nodes due within N days (includes overdue)

Implemented in service layer with post-fetch filtering, threaded through
API client and server, and exposed via CLI flags.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 05:06:35 +02:00
parent 8357c80e75
commit f2521be158
5 changed files with 48 additions and 1 deletions

View File

@@ -11,6 +11,8 @@ import (
var lTags, lRels []string
var lStatus, lPrio, lType, lNamespace, lAssignee, lMention string
var lDue bool
var lDueWithin int
var listCmd = &cobra.Command{
Use: "list", Short: "List nodes",
@@ -22,6 +24,11 @@ var listCmd = &cobra.Command{
}
var filter service.ListFilter
filter.HasDueDate = lDue
if lDueWithin >= 0 {
n := lDueWithin
filter.DueWithin = &n
}
// --tag is an alias for a label filter with no target.
for _, tag := range lTags {
@@ -76,4 +83,6 @@ func init() {
f.StringVar(&lNamespace, "namespace", "", "filter by namespace")
f.StringVar(&lAssignee, "assignee", "", "filter by assignee")
f.StringVar(&lMention, "mention", "", "filter by mention")
f.BoolVar(&lDue, "due", false, "filter to nodes with a due date")
f.IntVar(&lDueWithin, "due-within", -1, "filter to nodes due within N days (includes overdue)")
}