This env.variable forces libsmartcols to use visible padding chars.
The standard debug has to be enabled (to minimize overhead for
non-debug execution).
For example:
$ LIBSMARTCOLS_DEBUG=all LIBSMARTCOLS_DEBUG_PADDING=on findmnt 2> ~/log
Signed-off-by: Karel Zak <kzak@redhat.com>
enables libblkid debug output.
.IP LIBSMARTCOLS_DEBUG=all
enables libsmartcols debug output.
+.IP LIBSMARTCOLS_DEBUG_PADDING=on
+use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
.SH "SEE ALSO"
.BR fdisk (8),
enables libblkid debug output.
.IP LIBSMARTCOLS_DEBUG=all
enables libsmartcols debug output.
+.IP LIBSMARTCOLS_DEBUG_PADDING=on
+use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
.SH "SEE ALSO"
.BR cfdisk (8),
unsigned int ascii :1, /* don't use unicode */
colors_wanted :1, /* enable colors */
is_term :1, /* isatty() */
+ padding_debug :1, /* output visible padding chars */
maxout :1, /* maximize output */
header_printed :1, /* header already printed */
no_headings :1, /* don't print header */
list_entry_is_last(&(_cl)->cl_columns, &(_tb)->tb_columns)
+static void check_padding_debug(struct libscols_table *tb)
+{
+ const char *str;
+
+ assert(libsmartcols_debug_mask); /* debug has to be enabled! */
+
+ str = getenv("LIBSMARTCOLS_DEBUG_PADDING");
+ if (!str || (strcmp(str, "on") != 0 && strcmp(str, "1") != 0))
+ return;
+
+ DBG(INIT, ul_debugobj(tb, "padding debug: ENABLE"));
+ tb->padding_debug = 1;
+}
+
/**
* scols_new_table:
*
INIT_LIST_HEAD(&tb->tb_columns);
DBG(TAB, ul_debugobj(tb, "alloc"));
+ ON_DBG(INIT, check_padding_debug(tb));
+
return tb;
}
* fallback to be more robust and backwardly compatible.
*/
#define titlepadding_symbol(tb) ((tb)->symbols->title_padding ? (tb)->symbols->title_padding : " ")
-#define cellpadding_symbol(tb) ((tb)->symbols->cell_padding ? (tb)->symbols->cell_padding: " ")
#define branch_symbol(tb) ((tb)->symbols->branch ? (tb)->symbols->branch : "|-")
#define vertical_symbol(tb) ((tb)->symbols->vert ? (tb)->symbols->vert : "|")
#define right_symbol(tb) ((tb)->symbols->right ? (tb)->symbols->right : "-")
+#define cellpadding_symbol(tb) ((tb)->padding_debug ? "." : \
+ ((tb)->symbols->cell_padding ? (tb)->symbols->cell_padding: " "))
+
/* This is private struct to work with output data */
struct libscols_buffer {
enables libmount debug output
.IP LIBSMARTCOLS_DEBUG=all
enables libsmartcols debug output
+.IP LIBSMARTCOLS_DEBUG_PADDING=on
+use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
.SH AUTHORS
.nf
Karel Zak <kzak@redhat.com>
enables libmount debug output.
.IP LIBSMARTCOLS_DEBUG=all
enables libsmartcols debug output.
+.IP LIBSMARTCOLS_DEBUG_PADDING=on
+use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
.SH SEE ALSO
.BR findmnt (8),
.BR blkid (8),