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

Option to force colored output #247

Open
giner opened this issue Feb 6, 2018 · 2 comments
Open

Option to force colored output #247

giner opened this issue Feb 6, 2018 · 2 comments

Comments

@giner
Copy link
Contributor

giner commented Feb 6, 2018

Following #246 it would be nice to have an option to force colored output when needed even when it is piped. This would be useful in scripts, e.g. output=$(spruce diff --colored ...) or with less, e.g. spruce diff --colored ... | less -R.

@phlummox
Copy link

Seconded :)

It seems to be reasonably standard to call such a parameter "--color", and let it take the options "always" (coloured), "never" (not coloured), and "auto" (coloured if a tty is detected). For instance, GNU grep, GNU ls, git log, shellcheck, and many other common tools use this naming scheme. It may therefore be worth doing the same, to benefit from users' likely familiarity with those tools.

@geofffranks
Copy link
Owner

Feel free to submit a PR for this @phlummox, it is https://hacktoberfest.digitalocean.com after all!

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

No branches or pull requests

3 participants