-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confusion behavior when running multiple recipes on line and the first of them has variable parameters (or optional one) #2365
Comments
Ah, good idea! I was going to point out this is just an issue with the command line in general but that is a good fix! |
Although I've never personally run into this, it has come up a few times. One idea would be to add an optional explicit grouping operator, probably
This is kind of verbose and annoying though. I don't think I would want to add a setting in the justfile itself, because something that controls how the command line is parsed doesn't feel like it belongs in a setting. Another option is to add a flag, like
Overall none of these options feel great. |
I like the The only issue I see with that is it could be a breaking change for many projects. Maybe hide the feature behind an edition? Hmm, the grouping thing is probably a better solution though. Is the following what you were suggesting @casey?
With maybe a shorthand not requiring the grouping symbols for the last group?
|
Related to #1556 For the grouping operator idea, to keep possible to pass all values as parameters, what about borrowing an idea from Rust's raw strings syntax: The opening delimiter can be any number of To run recipe foo followed by recipe bar, with all default values for foo's parameters
To run recipe foo with "]" as its first parameter and its other parameters at default values, followed by running recipe bar
There is still the caveat that the opening Another possibility could be a command-line option which, if set, enables using opening and closing delimiters and defines what they are:
The |
I like |
Draft PR here which adds a |
Added the |
With justfile:
just foo bar
executes onlyfoo
recipe with parameterbar
The even more confusion we experienced was when the first recipe lost its parameters:
Now
just foo bar
executes both recipes.This can be super harmful mainly in CI, when it accidentally runs two recipes instead of one or vice versa. It is hard to notice it has different behavior than it had before.
I understand the main selling point is deduplication of shared dependencies and I don't have the "right" proposal how to have safe behavior and dedup together in all cases.
However for our use case there could be a new settings that will disable the possibility to run multiple recipes on one line.
The text was updated successfully, but these errors were encountered: