Open t3hmrman opened 1 month ago
I have a similar use case: I use a justfile
to run some commands with a specific environment.
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.
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.