mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-27 04:32:16 +03:00
Add color output to zfs diff.
This adds support to color zfs diff (in the style of git diff) conditional on the ZFS_COLOR environment variable. Signed-off-by: Ethan Coe-Renner <coerenner1@llnl.gov>
This commit is contained in:
committed by
Tony Hutter
parent
24502bd3a7
commit
fb11b1570a
@@ -2010,15 +2010,20 @@ use_color(void)
|
||||
void
|
||||
color_start(const char *color)
|
||||
{
|
||||
if (use_color())
|
||||
if (use_color()) {
|
||||
fputs(color, stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
color_end(void)
|
||||
{
|
||||
if (use_color())
|
||||
if (use_color()) {
|
||||
fputs(ANSI_RESET, stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* printf() with a color. If color is NULL, then do a normal printf. */
|
||||
|
||||
Reference in New Issue
Block a user