Skip to content

Enhance pueue edit UX #553

@pacien

Description

@pacien

Hello, and thank you for this very useful program!

I often forget to pass some options when adding new tasks,
and find myself needing to edit those, often in batch.

The current edit sub-command opens an editor for each value to edit,
which is quite cumbersome when just wanting to replace a value,
especially for multiple tasks at once.

Therefore, I think it would be nice for the edit sub-command to:

  • accept mulitple task IDs at once, and
  • accept replacement values directly from the CLI,
    to be applied to all the specified tasks at once.

Current help text of the edit sub-command:

❯ pueue edit --help
Edit the command, path, label, or priority of a stashed or queued task.
By default only the command is edited.
Multiple properties can be added in one go.

Usage: pueue edit [OPTIONS] <TASK_ID>

Arguments:
  <TASK_ID>  The task's id

Options:
  -c, --command   Edit the task's command
  -p, --path      Edit the task's path
  -l, --label     Edit the task's label
  -o, --priority  Edit the task's priority
  -h, --help      Print help

Target help text with the suggested additions:

❯ pueue edit --help
Edit the command, path, label, or priority of a stashed or queued task(s).
Values specified in options are used as replacements.
When no option is specified, EDITOR is opened.

Usage: pueue edit [OPTIONS] [TASK_IDS]...

Arguments:
  [TASK_IDS]...  The task(s) id

Options:
  -c, --command <COMMAND>    Edit the task(s)' command
  -p, --path <PATH>          Edit the task(s)' path
  -l, --label <LABEL>        Edit the task(s)' label
  -o, --priority <PRIORITY>  Edit the task(s)' priority
  -h, --help                 Print help

When no replacement option is supplied on the CLI,
the default EDITOR can be used to edit the properties.

But instead of opening the EDITOR for each value for each task individually,
this could be done in a combined way in a single YAML or TOML file.

For example, running pueue edit 0 1 would open an EDITOR with:

[0]
command = "echo this is my first command"
path = "/home/user"
label =
priority = 0

[1]
command = "echo this is my second command"
path = "/home/user/whatever"
label =
priority = 5

Since the current edit sub-command is quite interactive,
these modificatinos shouldn't break existing automated user scripts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions