Skip to content

butter tasks update is advertised in help but has no dispatcher branch #10

Description

@ryanlitalien

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions