]> git.ipfire.org Git - pakfire.git/commitdiff
cli: table: Lets hope that we won't have tables wider than the screen
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 1 Jul 2025 16:18:42 +0000 (16:18 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 1 Jul 2025 16:18:42 +0000 (16:18 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/cli/lib/table.c

index 5d4cb4e6d4bc092d8b272f2e5a5637295999670c..f6c74a5f274c6af8eac73a59096f0fe0fc54754e 100644 (file)
@@ -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)