return r;
}
-static size_t cli_table_width(cli_table* self) {
- cli_table_col* col = NULL;
- size_t width = 0;
-
- // An empty table has no width
- if (STAILQ_EMPTY(&self->cols))
- return 0;
-
- STAILQ_FOREACH(col, &self->cols, nodes)
- width += col->width + 1;
-
- return width - 1;
-}
-
static int cli_table_col_is_last(cli_table* self, cli_table_col* col) {
cli_table_col* c = NULL;
unsigned int i = 0;
if (STAILQ_EMPTY(&self->cols))
return 0;
- // Determine the minimum width that we
- size_t width = cli_table_width(self);
-
- // XXX What do we do when we are larger than the terminal is wide?
-
// Print the header
r = cli_table_print_header(self, f);
if (r < 0)