-
-
Notifications
You must be signed in to change notification settings - Fork 625
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
Add an option to allow multiple wildcard matches and only run the first match #1688
Comments
This was discussed when adding wildcard support. We can use this issue to track support for this. |
I will do you one better. It would be nice to actually be able to use RegExp instead of just a Maybe add this as an experiment? Or maybe make a different enough syntax so it break the least amount of existing taskfiles - like |
@DerpgonCz regex wildcards have been discussed before. We decided not to implement them since the complexity of the feature outweighed the benefit. If you can provide a concrete proposal and use-case for this then we could take another look, but I think this beyond the scope of this issue. |
I see, I did not know it was discussed before. Understandably, it would not be a simple task to achieve and would require some planning and writing down the use-cases. I have some stuff in mind, but, unarguably, most of actual use-cases can be achieved via regular arguments. I rest my case then. |
Consider this case:
If I run
task some_job:some_opt
, it will throw an error:Essentially, by using '*', I want to match things that does not contain a
:
instead of matching everything. I don't think this is possible under current taskfile's mechanism.I need to do this since both
some_job
andsome_opt
are dynamic in my case. I can't statically list all the available choices. Even if I can, there will be too many of them, which requires a lot of boilerplate tasks. A worse thing is that the list might be dynamically updating. One possible choice is to override vars:task JOB_TYPE=some_job OPTION=some_opt
, but this makes the syntax too cumbersome and almost defies the purpose of using task.Is it possible to add a top-level option, for example
use_first_wildcard_match: true
, to allow this behavior?The text was updated successfully, but these errors were encountered: