diff options
author | Damjan Marion <damarion@cisco.com> | 2023-11-13 21:46:48 +0000 |
---|---|---|
committer | Dave Wallace <dwallacelf@gmail.com> | 2023-11-14 21:33:09 +0000 |
commit | dd8f8dec50a4b572a09e3168a92c2a09db42b9f3 (patch) | |
tree | bb44285b84d2f3a90c3f57ae8355bd95811662a6 /src/vppinfra/format_table.c | |
parent | f6f21db2e30b83236464887df62f50a189bbb859 (diff) |
vppinfra: respect indent in format_table
Change-Id: Ib7e5cb5adfe81e5cc6243125d91f5179608a7733
Type: improvement
Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vppinfra/format_table.c')
-rw-r--r-- | src/vppinfra/format_table.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vppinfra/format_table.c b/src/vppinfra/format_table.c index 5fe7521af86..dd92e417acd 100644 --- a/src/vppinfra/format_table.c +++ b/src/vppinfra/format_table.c @@ -125,6 +125,7 @@ format_table (u8 *s, va_list *args) table_t *t = va_arg (*args, table_t *); table_cell_t title_cell = { .text = t->title }; int table_width = 0; + u32 indent = format_get_indent (s); for (int i = 0; i < vec_len (t->row_sizes); i++) table_width += t->row_sizes[i]; @@ -134,7 +135,7 @@ format_table (u8 *s, va_list *args) title_default = t->default_title.as_u32 ? &t->default_title : &default_title; s = format_text_cell (t, s, &title_cell, title_default, table_width); - s = format (s, "\n"); + s = format (s, "\n%U", format_white_space, indent); } for (int c = 0; c < vec_len (t->cells); c++) @@ -161,7 +162,7 @@ format_table (u8 *s, va_list *args) t->row_sizes[r]); } if (c + 1 < vec_len (t->cells)) - s = format (s, "\n"); + s = format (s, "\n%U", format_white_space, indent); } return s; |