Add more ANSI colors to libzfs

Reviewed-by: WHR <msl0000023508@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ethan Coe-Renner <coerenner1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Closes #14621
This commit is contained in:
Tino Reichardt
2023-03-13 23:23:04 +01:00
committed by Brian Behlendorf
parent d2d4f8554f
commit 80f2cdcd67
3 changed files with 17 additions and 8 deletions
+3 -3
View File
@@ -55,10 +55,10 @@
#define ZDIFF_REMOVED '-'
#define ZDIFF_RENAMED "R"
#define ZDIFF_ADDED_COLOR ANSI_GREEN
#define ZDIFF_ADDED_COLOR ANSI_GREEN
#define ZDIFF_MODIFIED_COLOR ANSI_YELLOW
#define ZDIFF_REMOVED_COLOR ANSI_RED
#define ZDIFF_RENAMED_COLOR ANSI_BLUE
#define ZDIFF_REMOVED_COLOR ANSI_RED
#define ZDIFF_RENAMED_COLOR ANSI_BOLD_BLUE
/*
* Given a {dsname, object id}, get the object path
+8 -5
View File
@@ -2011,10 +2011,11 @@ use_color(void)
}
/*
* color_start() and color_end() are used for when you want to colorize a block
* of text. For example:
* The functions color_start() and color_end() are used for when you want
* to colorize a block of text.
*
* color_start(ANSI_RED_FG)
* For example:
* color_start(ANSI_RED)
* printf("hello");
* printf("world");
* color_end();
@@ -2022,7 +2023,7 @@ use_color(void)
void
color_start(const char *color)
{
if (use_color()) {
if (color && use_color()) {
fputs(color, stdout);
fflush(stdout);
}
@@ -2038,7 +2039,9 @@ color_end(void)
}
/* printf() with a color. If color is NULL, then do a normal printf. */
/*
* printf() with a color. If color is NULL, then do a normal printf.
*/
int
printf_color(const char *color, const char *format, ...)
{