From f8f92584db8ca9abd470c90a20d2b1a3aebfffaa Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 2 Jun 2026 11:40:57 +0100 Subject: [PATCH] sysupdate: Improve empty table when printing features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than just printing out the table header and then exiting, print “No features” similarly to what `loginctl` or `storagectl` do. --- src/sysupdate/sysupdate.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/sysupdate/sysupdate.c b/src/sysupdate/sysupdate.c index 01b4a03f4d..48e1445de2 100644 --- a/src/sysupdate/sysupdate.c +++ b/src/sysupdate/sysupdate.c @@ -1975,7 +1975,16 @@ static int verb_features(int argc, char *argv[], uintptr_t _data, void *userdata return table_log_add_error(r); } - return table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend); + r = table_print_with_pager(table, arg_json_format_flags, arg_pager_flags, arg_legend); + if (r < 0) + return r; + + if (arg_legend) { + if (table_isempty(table)) + log_info("No features."); + else + printf("\n%zu features listed.\n", table_get_rows(table) - 1); + } } else { _cleanup_(sd_json_variant_unrefp) sd_json_variant *json = NULL; _cleanup_strv_free_ char **features = NULL;