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

Coloured --diff output #994

Closed
selurvedu opened this issue Aug 23, 2019 · 2 comments · Fixed by #1266
Closed

Coloured --diff output #994

selurvedu opened this issue Aug 23, 2019 · 2 comments · Fixed by #1266

Comments

@selurvedu
Copy link

There is an option in diffutils:

--color [=when]

Specify whether to use color for distinguishing different contexts, like header, added or removed lines. when may be omitted, or one of:

  • none Do not use color at all. This is the default when no --color option is specified.
  • auto Use color only if standard output is a terminal.
  • always Always use color.

Specifying --color and no when is equivalent to --color=auto.

It would be nice if Black had a similar option, probably with a different name.

@Peque
Copy link

Peque commented Dec 22, 2019

Ugly hack (ideally Black should be able to output with colors out-of-the-box):

black --diff . | colordiff

@selurvedu
Copy link
Author

@Peque yeah, I used that workaround before.

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 a pull request may close this issue.

2 participants