It would be nice if default parameters were evaluated in --usage and --list, at least for const expressions, since const expressions are already evaluated for help strings. As an example of the current behavior:
you := 'world'
[arg('name', help='Defaults to ' + you)]
hello name=you:
echo 'Hello, {{ name }}!'
j --usage hello
Usage: just hello [name]
Arguments:
[name] Defaults to world [default: you]
I guess it's distinguishable as the variable you rather than the literal string "you" since it's unquoted, but to me, it looks a bit misleading, especially if you're just running --usage or --list without having looked through the justfile to see that you is a variable.
It looks like #1411 might be usable as a starting point if this was to be implemented. That was using a --evaluate flag, but other possibilities I can think of are just making this the default behavior and/or making it a setting.
It would be nice if default parameters were evaluated in
--usageand--list, at least for const expressions, since const expressions are already evaluated for help strings. As an example of the current behavior:I guess it's distinguishable as the variable
yourather than the literal string"you"since it's unquoted, but to me, it looks a bit misleading, especially if you're just running--usageor--listwithout having looked through thejustfileto see thatyouis a variable.It looks like #1411 might be usable as a starting point if this was to be implemented. That was using a
--evaluateflag, but other possibilities I can think of are just making this the default behavior and/or making it a setting.