Skip to content

tk list: --type/--priority filters + fail-fast on unknown args#60

Open
ipreuss wants to merge 3 commits intowedow:masterfrom
ipreuss:ticket/M3R-0uem
Open

tk list: --type/--priority filters + fail-fast on unknown args#60
ipreuss wants to merge 3 commits intowedow:masterfrom
ipreuss:ticket/M3R-0uem

Conversation

@ipreuss
Copy link
Copy Markdown

@ipreuss ipreuss commented Apr 23, 2026

Two-commit bundle improving tk list argument handling.

Commit 1 (39af9b7) — feat(list): add --type and --priority filters with value validation

  • Adds --type=<bug|feature|task|epic|chore> (long) and -t <value> (short).
  • Adds --priority=<0..4> (long) and -p <value> (short).
  • Both flags filter on YAML frontmatter via the existing awk pass; pre-validates values with stderr + exit 2 on invalid input.
  • Adds priority to the awk frontmatter extraction (was previously not parsed).
  • Pattern mirrors the existing --status/-a/-T filters in plugins/ticket-ls.

Commit 2 (c51d640) — fix(list): fail-fast on unknown arguments

  • Replaces silent-ignore catch-all (*) shift ;;) with stderr + exit 2 naming the bad arg.
  • Closes the silent-ignore UX trap where tk ls --typo=foo returned the full list with no warning.
  • Error format matches the intra-file convention (ticket list: <issue> prefix, exit 2).

Tests

Full BDD suite: 13 features / 144 scenarios / 950 steps — all passed.

  • 4 new scenarios for unknown-arg fail-fast (long flag, short flag, positional, exit-code-2 pin)
  • 11 new scenarios across the two filter implementations
  • New `@then 'the command should exit with code N'` step pins the POSIX usage-error code against future drift.

Order rationale

Commit 1 must land before Commit 2: hardening the catch-all before adding the new filter cases would cause `--type=` / `--priority=` / `-t` / `-p` to error on the first commit. With Commit 1 on the branch first, Commit 2 can safely fail-fast on truly unknown args.

Both commits land on the same branch (`ticket/M3R-0uem`) by design — they share the same `case`-statement and are easier to review together.

ipreuss and others added 3 commits April 14, 2026 11:37
Adds `tk update <id> --field=value` for modifying YAML frontmatter
fields without opening an editor. Useful for AI agents and scripts.

Features:
- Update single or multiple fields in one command
- JSON array syntax with jq: --tags='["a", "b"]' → tags: [a, b]
- Graceful fallback when jq unavailable
- Proper error handling for invalid arguments/JSON

Also fixes update_yaml_field to work on macOS/BSD by using awk
instead of GNU-specific sed syntax for inserting new fields.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
*) catch-all in ticket-ls args loop now exits 2 with a stderr
message naming the bad arg, instead of silently ignoring.

Closes the silent-ignore UX trap for `ticket ls` described in
M3R-eb6t. The `tk edit` reproducer in the same ticket is covered
by the follow-up ticket M3R-dssb (out of M3R-dy1f scope).

Ticket: M3R-eb6t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant