Nukesor / pueue

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

Make 'pueue add -g Group' add the Group if it doesn't exist #507

Closed Schweber closed 3 months ago

Schweber commented 3 months ago

A detailed description of the feature you would like to see added.

I would like pueue add -g Group -- Task not to fail when Group does not exist but instead add the group. This should be behind a flag so as not to change the current default behaviour.

Explain your usecase of the requested feature

It would make it easier to use pueue as the current state of pueue and its groups would not matter anymore and i could always send the commands as if the group did exist already.

Alternatives

I could write a script that checks if the group already exists and remove it if this is the case, before running the command for adding the task. The new feature would just be a QoL improvement.

Additional context

No response

Nukesor commented 3 months ago

Could you elaborate your use case? Why exactly do you want to be able to quickly create arbitrary groups?

Could you give me a scenario or an example of how you're using pueue and what exactly you want this feature for?

As to how such a feature would look like:

Schweber commented 3 months ago

My use case is that i want to "look after" my backups in different locations from time to time so i'll have to run certain commands in order for each location (prune, check, list etc.) but doing so in parallel speeds it up tremendously because the limiting factor is ping rather than bandwidth. So i have an alias to create a group for each location with parallel limit 1 and let them run.

As there might be a long time in between this action, i might remove the groups in the meantime (or not). So whether or not my backup command will succeed depends on the state of pueue (e.g. do the groups exist already or not). But i can handle this with a script, no problem.

Anyway, Thank you for making pueue!

Nukesor commented 3 months ago

To be honest, this indeed sounds like a pretty specific usecase and a script is probably a neat solution for this problem, especially since it sounds like you're already scripting most of the stuff anyway.

I will close this issue for now as "wont do", but if more people have the need for such a feature, it's always possible to reconsider :)