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

Add env variable to configure locked, frozen and color #726

Merged
merged 8 commits into from
Jan 31, 2024

Conversation

hadim
Copy link
Contributor

@hadim hadim commented Jan 29, 2024

See #714 for context.

In short, it adds:

  • PIXI_COLOR to configure --color
  • PIXI_LOCKED to configure --locked
  • PIXI_FROZEN to configure --frozen

I could not find a way to configure --quiet and --verbose since the Verbosity struct belongs to clap_verbosity_flag.

I went the easy way for the name of the env variables, but please let me know if you prefer something else.


TODO:

  • write doc for the new env variables.

@ruben-arts
Copy link
Contributor

This looks good to me, please describe it in the docs.

@hadim
Copy link
Contributor Author

hadim commented Jan 30, 2024

I added the doc.

I tried to tweak args.verbose to add env variable support to it, but args.verbose.verbose and args.verbose.quiet are private, so I can't modify those without modifying clap-verbosity-flag itself.

@hadim
Copy link
Contributor Author

hadim commented Jan 30, 2024

I tried to tweak args.verbose to add env variable support to it, but args.verbose.verbose and args.verbose.quiet are private, so I can't modify those without modifying clap-verbosity-flag itself.

xref with clap-rs/clap-verbosity-flag#53 (comment)

@wolfv
Copy link
Member

wolfv commented Jan 30, 2024

For PIXI_COLOR it might be good to also respect the standard variables: https://github.com/prefix-dev/rattler-build/blob/d502a2bf4eb4b46a2b38015f74d232177e7dda44/src/env_vars.rs#L195-L208

CLICOLOR_FORCE or FORCE_COLOR, and NO_COLOR

https://docs.conan.io/2/reference/environment.html#terminal-color-variables
https://force-color.org/
https://bixense.com/clicolors/

Not sure which one is more widely adopted though.

src/cli/mod.rs Show resolved Hide resolved
@ruben-arts ruben-arts merged commit 97f882d into prefix-dev:main Jan 31, 2024
11 checks passed
@ruben-arts
Copy link
Contributor

Thanks again @hadim

@hadim hadim deleted the env branch January 31, 2024 13:40
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 this pull request may close these issues.

4 participants