Search code examples
rubycommand-line-interfacethor

Disable color for thor


I have a CLI app that uses Thor.

Right now, it uses colors for a lot of output, which looks nice but causes issues with piping to scripts and such.

However, it's going to be a rather large refactor to add options every time I use a color.

Is there an easy way to just ignore all color options in Thor?


Solution

  • Thor is smart enough to read the env variable:

    export THOR_SHELL=Basic