Sitelet https://github.com/casey/just/issues/3728
Skip to content

Evaluate default parameters for --usage and --list (at least const expressions) #3728

Description

@noahkawaguchi

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions