Nukesor / pueue

:stars: Manage your shell commands.
MIT License
4.9k stars 132 forks source link

[Bug] CLI parsing error when adding a task with a priority using `-o` or `--priority` #486

Closed wjv closed 9 months ago

wjv commented 9 months ago

Describe the bug

When adding a prioritised task with pueue add -o INT "<task>", the CLI parser somehow sees the quoted task as a priority integer. Both the short flag (-o) and the long flag (--priority) are affected.

Steps to reproduce

  1. I attempt to add ad a task with pueue add -o 10 "sleep 60"
  2. pueue exits with error code 2, and the following error message:
error: invalid value 'sleep 60' for '--priority <PRIORITY>...': invalid digit found in string

Debug logs (if relevant)

No response

Operating system

macOS 14.2.1

Pueue version

v3.3.2

Additional context

No response

wjv commented 9 months ago

I should add that…

pueue add -o 10 -- "sleep 60"

does work as expected. So that's a trivial workaround. :)

Nukesor commented 9 months ago

I did a copy-paste bug and forced list parsing on priority -.-

I'll push a point release with a fix for this soonish.

For the time being, you can also use -o=10

Nukesor commented 9 months ago

v3.3.3 is released :)