1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-24 06:04:05 +03:00

machinectl: don't output "No machines." with --no-legend option (#4593)

This commit is contained in:
Viktar Vaŭčkievič 2016-11-06 17:19:57 +03:00 committed by Zbigniew Jędrzejewski-Szmek
parent b05422a8cf
commit f9b1947f9b

View File

@ -330,10 +330,12 @@ static int list_machines(int argc, char *argv[], void *userdata) {
printf("-\n"); printf("-\n");
} }
if (arg_legend && n_machines > 0) if (arg_legend) {
printf("\n%zu machines listed.\n", n_machines); if (n_machines > 0)
else printf("\n%zu machines listed.\n", n_machines);
printf("No machines.\n"); else
printf("No machines.\n");
}
out: out:
clean_machine_info(machines, n_machines); clean_machine_info(machines, n_machines);
@ -463,10 +465,12 @@ static int list_images(int argc, char *argv[], void *userdata) {
(int) max_mtime, strna(format_timestamp(mtime_buf, sizeof(mtime_buf), images[j].mtime))); (int) max_mtime, strna(format_timestamp(mtime_buf, sizeof(mtime_buf), images[j].mtime)));
} }
if (arg_legend && n_images > 0) if (arg_legend) {
printf("\n%zu images listed.\n", n_images); if (n_images > 0)
else printf("\n%zu images listed.\n", n_images);
printf("No images.\n"); else
printf("No images.\n");
}
return 0; return 0;
} }
@ -2489,10 +2493,12 @@ static int list_transfers(int argc, char *argv[], void *userdata) {
(int) max_local, transfers[j].local, (int) max_local, transfers[j].local,
(int) max_remote, transfers[j].remote); (int) max_remote, transfers[j].remote);
if (arg_legend && n_transfers > 0) if (arg_legend) {
printf("\n%zu transfers listed.\n", n_transfers); if (n_transfers > 0)
else printf("\n%zu transfers listed.\n", n_transfers);
printf("No transfers.\n"); else
printf("No transfers.\n");
}
return 0; return 0;
} }