From b9879cbfc79ed78895ac597a28a8e537c1074957 Mon Sep 17 00:00:00 2001 From: Bjoern Walk Date: Tue, 15 Oct 2024 16:11:30 +0200 Subject: [PATCH] hyptop: Don't show visualization in structured output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The utilization visualization column does not provide meaningful data when using structured output. Omit it when an output format has been specified on the command line. Reviewed-by: Mete Durlu Signed-off-by: Bjoern Walk Signed-off-by: Jan Höppner --- hyptop/win_sys.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hyptop/win_sys.c b/hyptop/win_sys.c index e46e8b46..3b6dc583 100644 --- a/hyptop/win_sys.c +++ b/hyptop/win_sys.c @@ -162,7 +162,8 @@ static void l_cpu_add(struct sd_cpu *cpu) continue; l_cpu_item_add(table_row, cpu, item); } - l_cpu_add_visual(table_row, cpu); + if (!g.o.format_specified) + l_cpu_add_visual(table_row, cpu); table_row_add(l_t, table_row); } @@ -365,9 +366,11 @@ void win_sys_init(void) col_vec[i] = col; col_desc_vec[i] = item->desc; } - col_vec[i] = &l_vis_col; - col_desc_vec[i] = vis_str; - table_col_add(l_t, &l_vis_col); + if (!g.o.format_specified) { + col_vec[i] = &l_vis_col; + col_desc_vec[i] = vis_str; + table_col_add(l_t, &l_vis_col); + } /* Enable fields */ if (win_sys.opts.fields.specified)