casey / just

🤖 Just a command runner
https://just.systems
Creative Commons Zero v1.0 Universal
17.6k stars 399 forks source link

set just flags through environment variables #1979

Open gsemet opened 1 month ago

gsemet commented 1 month ago

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:

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 commented 1 month ago

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