cgtop: underline table header

Let's underline the header line of the table shown by cgtop, how it is
customary for tables. In order to do this, let's introduce new ANSI
underline macros, and clean up the existing ones as side effect.
This commit is contained in:
Lennart Poettering
2015-09-22 16:30:42 +02:00
parent 3ade55d31b
commit 1fc464f6fb
24 changed files with 172 additions and 152 deletions
+2 -2
View File
@@ -97,10 +97,10 @@ int ask_password_tty(
goto finish;
}
loop_write(ttyfd, ANSI_HIGHLIGHT_ON, sizeof(ANSI_HIGHLIGHT_ON)-1, false);
loop_write(ttyfd, ANSI_HIGHLIGHT, sizeof(ANSI_HIGHLIGHT)-1, false);
loop_write(ttyfd, message, strlen(message), false);
loop_write(ttyfd, " ", 1, false);
loop_write(ttyfd, ANSI_HIGHLIGHT_OFF, sizeof(ANSI_HIGHLIGHT_OFF)-1, false);
loop_write(ttyfd, ANSI_NORMAL, sizeof(ANSI_NORMAL)-1, false);
new_termios = old_termios;
new_termios.c_lflag &= ~(ICANON|ECHO);
+6 -6
View File
@@ -117,11 +117,11 @@ static bool print_multiline(FILE *f, unsigned prefix, unsigned n_columns, Output
if (flags & OUTPUT_COLOR) {
if (priority <= LOG_ERR) {
color_on = ANSI_HIGHLIGHT_RED_ON;
color_off = ANSI_HIGHLIGHT_OFF;
color_on = ANSI_HIGHLIGHT_RED;
color_off = ANSI_NORMAL;
} else if (priority <= LOG_NOTICE) {
color_on = ANSI_HIGHLIGHT_ON;
color_off = ANSI_HIGHLIGHT_OFF;
color_on = ANSI_HIGHLIGHT;
color_off = ANSI_NORMAL;
}
}
@@ -455,8 +455,8 @@ static int output_verbose(
fieldlen = c - (const char*) data;
if (flags & OUTPUT_COLOR && startswith(data, "MESSAGE=")) {
on = ANSI_HIGHLIGHT_ON;
off = ANSI_HIGHLIGHT_OFF;
on = ANSI_HIGHLIGHT;
off = ANSI_NORMAL;
}
if (flags & OUTPUT_SHOW_ALL ||