Nukesor / pueue

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

[Bug] Cannot specify stashed tasks as dependencies for the new tasks #520

Closed curldivergence closed 3 months ago

curldivergence commented 3 months ago

Describe the bug

Hi! I'm not sure if this is by design or not, but it seems like it's not possible to use a stashed task as a dependency. And if this is by design, maybe it's worth it to make the error message more elaborate? Thanks!

Steps to reproduce

  1. Add a stashed task:
    $ pu add -s 'echo Hello!'
    $ pu
    Group "default" (1 parallel): running
    ─────────────────────────────────────────────────────────────────────
    Id   Status    Command       Path                       Start   End
    ═════════════════════════════════════════════════════════════════════
    0    Stashed   echo Hello!   /Users/user/TestDir
    ─────────────────────────────────────────────────────────────────────
  2. Add another one, dependent on the previous one, and observe the error:
    
    $ pu add -a 0 'echo Hello!'                                                                                                                                                                                      03/28/2024 11:48:58 AM
    error: invalid value 'echo Hello!' for '--after <after>...': invalid digit found in string

For more information, try '--help'.



### Debug logs (if relevant)

_No response_

### Operating system

macOS 14.3.1

### Pueue version

v3.4.0

### Additional context

_No response_
curldivergence commented 3 months ago

Sorry for bothering, please disregard this report :) The problem was that I forgot to add -- between -a 0 and the command: the -s key works even without --, but -a does not, so I thought that the problem was with the latter option.

Nukesor commented 3 months ago

That's because the -a flag excepts a list of elements and the way arguments are parsed :)

To be less succeptible to such issues, using a = is a nice way to prevent such ambiguities. I.e. pueue add -a=0 echo joooo works just fine

curldivergence commented 3 months ago

Good to know, thanks a lot for help :)