Convert more programs to the new option and verb parsers (#41458)
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user