GithubHelp home page GithubHelp logo

NO_COLOR support about color-eyre HOT 3 OPEN

eyre-rs avatar eyre-rs commented on July 24, 2024 11
NO_COLOR support

from color-eyre.

Comments (3)

yaahc avatar yaahc commented on July 24, 2024

Glad to hear you're enjoying color-eyre 😊.

a mention of this particular pattern in the docs (I searched and couldn't find anything)

Happy to add this. Do you remember where you searched for this first? I figure those will be the best places to put the example to make sure ppl find it in the future.

a change to HookBuilder::blank() selecting either the default dark theme or the blank theme based on the presence of NO_COLOR

Also happy with doing this, I think I have a preference for the former suggestion but I don't mind this one or even doing both.

I'm sure you've already seen this, but I found https://no-color.org/ helpful

I hadn't seen this! I think this would be a good link to include in any updated examples we end up adding for this.

I'm sorry I don't have the time right now to write up a draft PR for you.

No worries! Thank you for taking the time to submit the issue.

from color-eyre.

pksunkara avatar pksunkara commented on July 24, 2024

There was quite a bit of work done on colorchoice crate as part of https://github.com/rust-cli/anstyle that handles the "should we color?" question. cc @epage

from color-eyre.

epage avatar epage commented on July 24, 2024

colorchoice is just about having a central global so CLI control doesn't need to be piped through the entire program.

For NO_COLOR, that would normally be handled via printing via anstream which has you write your colors and then strips them depending on the environment the program is running within

from color-eyre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.