updatectl: check: Don't print an empty table

If there are no updates available, `updatectl check` would previously
just print an empty table. We should instead just tell the user that
there are no updates available.
This commit is contained in:
Adrian Vovk
2024-09-19 08:33:02 -04:00
parent bc9a9177b2
commit 802d9b18e9
+5
View File
@@ -788,6 +788,11 @@ static int verb_check(int argc, char **argv, void *userdata) {
if (r < 0)
return log_error_errno(r, "Failed to start event loop: %m");
if (table_isempty(table)) {
log_info("No updates available.");
return 0;
}
return table_print_with_pager(table, SD_JSON_FORMAT_OFF, arg_pager_flags, arg_legend);
}