mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
machinectl: don't output "No machines." with --no-legend option (#4593)
This commit is contained in:
parent
b05422a8cf
commit
f9b1947f9b
@ -330,10 +330,12 @@ static int list_machines(int argc, char *argv[], void *userdata) {
|
||||
printf("-\n");
|
||||
}
|
||||
|
||||
if (arg_legend && n_machines > 0)
|
||||
printf("\n%zu machines listed.\n", n_machines);
|
||||
else
|
||||
printf("No machines.\n");
|
||||
if (arg_legend) {
|
||||
if (n_machines > 0)
|
||||
printf("\n%zu machines listed.\n", n_machines);
|
||||
else
|
||||
printf("No machines.\n");
|
||||
}
|
||||
|
||||
out:
|
||||
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)));
|
||||
}
|
||||
|
||||
if (arg_legend && n_images > 0)
|
||||
printf("\n%zu images listed.\n", n_images);
|
||||
else
|
||||
printf("No images.\n");
|
||||
if (arg_legend) {
|
||||
if (n_images > 0)
|
||||
printf("\n%zu images listed.\n", n_images);
|
||||
else
|
||||
printf("No images.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -2489,10 +2493,12 @@ static int list_transfers(int argc, char *argv[], void *userdata) {
|
||||
(int) max_local, transfers[j].local,
|
||||
(int) max_remote, transfers[j].remote);
|
||||
|
||||
if (arg_legend && n_transfers > 0)
|
||||
printf("\n%zu transfers listed.\n", n_transfers);
|
||||
else
|
||||
printf("No transfers.\n");
|
||||
if (arg_legend) {
|
||||
if (n_transfers > 0)
|
||||
printf("\n%zu transfers listed.\n", n_transfers);
|
||||
else
|
||||
printf("No transfers.\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user