Skip to content
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

set just flags through environment variables #1979

Closed
gsemet opened this issue Mar 25, 2024 · 1 comment · Fixed by #2044
Closed

set just flags through environment variables #1979

gsemet opened this issue Mar 25, 2024 · 1 comment · Fixed by #2044

Comments

@gsemet
Copy link

gsemet commented Mar 25, 2024

Hello

It seems like some flags/options passed through parameter, such as --command-color, cannot be set by environment variable. It could be good to allow setting parameter also from environment variable (some other tickets refered this subject #1829 and #1702).

I would need the following environment variables:

  • --dry-run / JUST_DRY_RUN=1
  • --quiet / JUST_QUIET=1
  • --verbose / JUST_VERBOSE=1
  • --color=always / JUST_COLOR=always
  • --command-color=green / JUST_COMMAND_COLOR=green
  • --justfile justfile / JUST_JUSTFILE=justfile
  • --working-directory workdir / JUST_WORKING_DIRECTORY=workdir

For example on Gitlab / Github, colors can be forced enabled by setting environment variable JUST_COLOR=always

Optionally, I would like to have default values for some flags in the justfile itself.

For instance, if the CI variables is defined (in Gitlab), set the JUST_COLOR to alway. And also, always set JUST_COMMAND_COLOR=green no matter the env.

@poliorcetics
Copy link
Contributor

If I get to implement #1829 the way I wish to, this will be fixed that way. I need the clap 4 upgrade in #1865 (I'll resolve the conflicts soon) first though, clap 2 was missing features to work with env variables and defaults

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants