Convert more programs to the new option and verb parsers (#41458)

This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-04-04 10:21:14 +02:00
committed by GitHub
51 changed files with 366 additions and 419 deletions
+1 -5
View File
@@ -82,11 +82,7 @@ static int dump_address_labels(sd_netlink *rtnl) {
return table_log_add_error(r);
}
r = table_print(table, NULL);
if (r < 0)
return table_log_print_error(r);
return 0;
return table_print_or_warn(table);
}
int verb_list_address_labels(int argc, char *argv[], uintptr_t _data, void *userdata) {
+2 -2
View File
@@ -79,9 +79,9 @@ int verb_list_links(int argc, char *argv[], uintptr_t _data, void *userdata) {
return table_log_add_error(r);
}
r = table_print(table, NULL);
r = table_print_or_warn(table);
if (r < 0)
return table_log_print_error(r);
return r;
if (arg_legend)
printf("\n%i links listed.\n", c);
+2 -2
View File
@@ -303,9 +303,9 @@ int verb_link_lldp_status(int argc, char *argv[], uintptr_t _data, void *userdat
}
}
r = table_print(table, NULL);
r = table_print_or_warn(table);
if (r < 0)
return table_log_print_error(r);
return r;
if (arg_legend) {
lldp_capabilities_legend(all);
+2 -2
View File
@@ -900,9 +900,9 @@ static int link_status_one(
on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational,
info->ifindex, info->name);
r = table_print(table, NULL);
r = table_print_or_warn(table);
if (r < 0)
return table_log_print_error(r);
return r;
return show_logs(info->ifindex, info->name);
}
+2 -2
View File
@@ -126,9 +126,9 @@ int system_status(sd_netlink *rtnl, sd_hwdb *hwdb) {
on_color_operational, glyph(GLYPH_BLACK_CIRCLE), off_color_operational,
strna(netifs_joined));
r = table_print(table, NULL);
r = table_print_or_warn(table);
if (r < 0)
return table_log_print_error(r);
return r;
return show_logs(0, NULL);
}