butter tasks update is listed in the help text but has no dispatcher branch, so it falls through to the unknown-subcommand error. Same class as #6.
Current behaviour
$ butter tasks update 42 --state done
Unknown subcommand for tasks: update
Why
The help advertises it:
tasks list | create | update Manage tasks, bugs, and backlog
The dispatcher only handles list and create. There is no tasksUpdate function. The backend already supports PATCH /api/v1/projects/:project_id/tasks/:id.
Fix
Add tasksUpdate, mirroring tasksCreate:
PATCH /api/v1/projects/:project_id/tasks/:id with the changed fields only
- flags:
--state, --priority, --type, --title, --assignee, matching whatever tasks create accepts
- usage error when the id is missing or no field flag is given
- plain and
--json output
if (subcmd === "update") return tasksUpdate(args); in the dispatcher
- tests in the style of the
projects show tests: happy path, --json, missing id, no fields, 404
Done when
butter tasks update <id> --state done --project <id> changes the task and prints the result, and npm test covers it.
butter tasks updateis listed in the help text but has no dispatcher branch, so it falls through to the unknown-subcommand error. Same class as #6.Current behaviour
Why
The help advertises it:
The dispatcher only handles
listandcreate. There is notasksUpdatefunction. The backend already supportsPATCH /api/v1/projects/:project_id/tasks/:id.Fix
Add
tasksUpdate, mirroringtasksCreate:PATCH /api/v1/projects/:project_id/tasks/:idwith the changed fields only--state,--priority,--type,--title,--assignee, matching whatevertasks createaccepts--jsonoutputif (subcmd === "update") return tasksUpdate(args);in the dispatcherprojects showtests: happy path,--json, missing id, no fields, 404Done when
butter tasks update <id> --state done --project <id>changes the task and prints the result, andnpm testcovers it.