Nukesor / pueue

:stars: Manage your shell commands.
MIT License
4.67k stars 128 forks source link

[Bug] pueue log for a specific group fails with an obscure error #506

Closed aQuigs closed 3 months ago

aQuigs commented 3 months ago

Describe the bug

It's not in the --help docs so this might actually be a documentation issue, but running pueue log --group testgroup gives this tip which implies you can filter by group:

pueue log --group testgroup
error: unexpected argument '--group' found

  tip: to pass '--group' as a value, use '-- --group'

But this syntax fails:

$ pueue log -- --group testgroup
error: invalid value '--group' for '[TASK_IDS]...': invalid digit found in string

For more information, try '--help'.

This also fails if specifying a task id. Ideally I'd expect this command to show the logs for all tasks in the group

Steps to reproduce

pueue group add testgroup
pueue add --group testgroup ls
pueue log -- --group testgroup

Debug logs (if relevant)

No response

Operating system

OSX 14.3.1

Pueue version

3.3.3

Additional context

No response

Nukesor commented 3 months ago
pueue log --group testgroup
error: unexpected argument '--group' found

  tip: to pass '--group' as a value, use '-- --group'

This error message tells you, that there's an unexpected argument. So there's apparently no --group argument/flag.

It then gives you a generic tip, in case you wanted to pass --group as value. So not as an argument, but as a string value. This is just shell specific syntax, take a look at the meaning of -- in shells.

$ pueue log -- --group testgroup
error: invalid value '--group' for '[TASK_IDS]...': invalid digit found in string

For more information, try '--help'.

You're now passing the strings --group and testgroup to the pueue log command, which only expects a list of integers. The program complains about this and gives you an exact error for this as well: invalid digit found in string

Nukesor commented 3 months ago

I assume you want to request a new feature to look at all logs from a specific group?

aQuigs commented 3 months ago

It then gives you a generic tip, in case you wanted to pass --group as value. So not as an argument, but as a string value. This is just shell specific syntax, take a look at the meaning of -- in shells.

Ah, that makes sense. The tip message threw me off. Thanks for responing; sorry for the confusion.

I assume you want to request a new feature to look at all logs from a specific group?

Yeah that'd be useful

Nukesor commented 3 months ago

Closed in favor of https://github.com/Nukesor/pueue/issues/509