-
Notifications
You must be signed in to change notification settings - Fork 454
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
Support for match
expressions
#1990
Comments
I have a similar use case: I use a One of the commands have subcommands and when running a specific subcommand, I want to pass extra args that are not required for other subcommands. Here is what I do in my file: EXTRA_ARG := "example"
my-command command *args='':
the-command {{ if command == "specific" { "specific --extra-arg " + EXTRA_ARG } else { command + " " + args } }} As you can see, this is not really intuitive to read and something like this could be easier to understand: EXTRA_ARG := "example"
my-command command *args='':
{{ match command:
"specific": "the-command specific --extra-arg " + EXTRA_ARG + " " + args
any: "the-command " + any + " " + args
}} Please note that this is an example of something I would find more readable but I'm not a "language designer" and I'm sure a better syntax can be found. |
I think this would be pretty reasonable. Syntax TBH, but I don't see why not. |
I personally like the idea of staying as close to the Rust syntax for |
Hey thanks for the awesome tool.
One thing I'd love to have from the Rust world in my
Justfile
s is thematch
expression. In particular I want to use it to achieve some cross-platform (somatch
ing onos()
for example).Does this seem feasible, and is it something we might want in
just
long term? I'm happy to do the work to implement if so.The text was updated successfully, but these errors were encountered: