Gabriella439 / nix-diff

Explain why two Nix derivations differ
BSD 3-Clause "New" or "Revised" License
357 stars 19 forks source link

Color escape codes are restricted to tty output #13

Closed Ekleog closed 6 years ago

Ekleog commented 6 years ago

Counter-balance of https://github.com/Gabriel439/nix-diff/issues/1: when I run nix-diff foo bar | less -R, I don't get colors (even though less -R should proxy them out).

This may be fixed by adding a --color=(never|auto|always) command-line parameter.

Gabriella439 commented 6 years ago

Pull request up here: https://github.com/Gabriel439/nix-diff/pull/14

Let me know if that works for you. I added the flags --color and --no-color and the absence of the flag indicates to use automatic color detection

Ekleog commented 6 years ago

Sounds great, thanks! I unfortunately don't have a testbed available right now.

BTW, the --color=(always|auto|never) option I proposed were picked from the “standard” of grep / rg / ls and maybe others I can't think of right now, but the choice of options is obviously yours, so long as there are options it fits my use case.

Thank you! :D

Gabriella439 commented 6 years ago

Alright, I'll match their option style

Ekleog commented 6 years ago

Great, thanks! I don't have a testing bed right now, do you want me to test later and report here? I can't guarantee anything about delays, though, currently being quite overwhelmed by various stuff.

Gabriella439 commented 6 years ago

@Ekleog: No need. I already tested it myself. I just wanted you to review the user interface

Ekleog commented 6 years ago

Great, thank you! :D

Gabriel Gonzalez notifications@github.com writes:

Closed #13 via #14.

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/Gabriel439/nix-diff/issues/13#event-1944464895

Gabriella439 commented 6 years ago

You're welcome! 🙂