From f171b7e386910e7d69ade1a5ffd9fd778a39b490 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 1 Jul 2025 16:18:42 +0000 Subject: [PATCH] cli: table: Lets hope that we won't have tables wider than the screen Signed-off-by: Michael Tremer --- src/cli/lib/table.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/cli/lib/table.c b/src/cli/lib/table.c index 5d4cb4e6..f6c74a5f 100644 --- a/src/cli/lib/table.c +++ b/src/cli/lib/table.c @@ -249,20 +249,6 @@ ERROR: 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; @@ -391,11 +377,6 @@ int cli_table_print(cli_table* self, FILE* f) { 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) -- 2.47.3