diff options
author | David Tardon <dtardon@redhat.com> | 2022-11-11 09:42:52 +0100 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-11-13 12:21:54 +0100 |
commit | 9e1344850fbb33cf8c084ab3042b95815fa43aa6 (patch) | |
tree | d8ae74f9137b00f72fa9776204f9da86f7bedd2b /src/analyze/analyze-timespan.c | |
parent | analyze-timestamp: port to vertical table (diff) | |
download | systemd-9e1344850fbb33cf8c084ab3042b95815fa43aa6.tar.xz systemd-9e1344850fbb33cf8c084ab3042b95815fa43aa6.zip |
analyze-timespan: port to vertical table
Diffstat (limited to 'src/analyze/analyze-timespan.c')
-rw-r--r-- | src/analyze/analyze-timespan.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/analyze/analyze-timespan.c b/src/analyze/analyze-timespan.c index f244ace04a..3fdf0f964c 100644 --- a/src/analyze/analyze-timespan.c +++ b/src/analyze/analyze-timespan.c @@ -22,39 +22,33 @@ int verb_timespan(int argc, char *argv[], void *userdata) { return r; } - table = table_new("name", "value"); + table = table_new_vertical(); if (!table) return log_oom(); - table_set_header(table, false); - assert_se(cell = table_get_cell(table, 0, 0)); r = table_set_ellipsize_percent(table, cell, 100); if (r < 0) return r; - r = table_set_align_percent(table, cell, 100); - if (r < 0) - return r; - assert_se(cell = table_get_cell(table, 0, 1)); r = table_set_ellipsize_percent(table, cell, 100); if (r < 0) return r; r = table_add_many(table, - TABLE_STRING, "Original:", + TABLE_FIELD, "Original", TABLE_STRING, *input_timespan); if (r < 0) return table_log_add_error(r); - r = table_add_cell_stringf(table, NULL, "%ss:", special_glyph(SPECIAL_GLYPH_MU)); + r = table_add_cell_stringf_full(table, NULL, TABLE_FIELD, "%ss", special_glyph(SPECIAL_GLYPH_MU)); if (r < 0) return table_log_add_error(r); r = table_add_many(table, TABLE_UINT64, output_usecs, - TABLE_STRING, "Human:", + TABLE_FIELD, "Human", TABLE_TIMESPAN, output_usecs, TABLE_SET_COLOR, ansi_highlight()); if (r < 0) |