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:
@@ -33,13 +33,13 @@ int main(int argc, char *argv[]) {
|
||||
assert_se(streq(p, " Foobar bar waldo "));
|
||||
free(p);
|
||||
|
||||
assert_se(p = strdup(ANSI_HIGHLIGHT_ON "Hello" ANSI_HIGHLIGHT_OFF ANSI_HIGHLIGHT_RED_ON " world!" ANSI_HIGHLIGHT_OFF));
|
||||
assert_se(p = strdup(ANSI_HIGHLIGHT "Hello" ANSI_NORMAL ANSI_HIGHLIGHT_RED " world!" ANSI_NORMAL));
|
||||
assert_se(strip_tab_ansi(&p, NULL));
|
||||
fprintf(stdout, "<%s>\n", p);
|
||||
assert_se(streq(p, "Hello world!"));
|
||||
free(p);
|
||||
|
||||
assert_se(p = strdup("\x1B[\x1B[\t\x1B[" ANSI_HIGHLIGHT_ON "\x1B[" "Hello" ANSI_HIGHLIGHT_OFF ANSI_HIGHLIGHT_RED_ON " world!" ANSI_HIGHLIGHT_OFF));
|
||||
assert_se(p = strdup("\x1B[\x1B[\t\x1B[" ANSI_HIGHLIGHT "\x1B[" "Hello" ANSI_NORMAL ANSI_HIGHLIGHT_RED " world!" ANSI_NORMAL));
|
||||
assert_se(strip_tab_ansi(&p, NULL));
|
||||
assert_se(streq(p, "\x1B[\x1B[ \x1B[\x1B[Hello world!"));
|
||||
free(p);
|
||||
|
||||
Reference in New Issue
Block a user