[lib] a little try with bold term chars
authorChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 19 Nov 2008 21:26:13 +0000 (22:26 +0100)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Wed, 19 Nov 2008 21:26:13 +0000 (22:26 +0100)
... to force feedback from the community. If proven to be harmful,
I can still revert the change, but it really enhance readability of
"show topo" and "multipath -l", in my opinion.

libmultipath/print.c

index 461e707..2ac5ad1 100644 (file)
@@ -759,6 +759,8 @@ snprint_multipath_topology (char * buff, int len, struct multipath * mpp,
        if (verbosity == 1)
                return snprint_multipath(buff, len, "%n", mpp);
 
+       c += sprintf(c, "%c[%dm", 0x1B, 1); /* bold on */
+
        if (verbosity > 1 &&
            mpp->action != ACT_NOTHING &&
            mpp->action != ACT_UNDEF)
@@ -770,6 +772,7 @@ snprint_multipath_topology (char * buff, int len, struct multipath * mpp,
                c += sprintf(c, " (%%w)");
 
        c += sprintf(c, " %%d %%s");
+       c += sprintf(c, "%c[%dm", 0x1B, 0); /* bold off */
 
        fwd += snprint_multipath(buff + fwd, len - fwd, style, mpp);
        if (fwd > len)