summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorViktar Vaŭčkievič <victorenator@gmail.com>2016-11-06 17:19:57 +0300
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-11-06 09:19:57 -0500
commitf9b1947f9b9bcdf2b28953a40b1c537038c2a958 (patch)
treed1cedcdf847b4e80baa5e83999df2050ffa81d88 /src/machine
parentb05422a8cf87c95e8fc801add5349b3f5d027f66 (diff)
machinectl: don't output "No machines." with --no-legend option (#4593)
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/machinectl.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 7b9be3b425..9c754b4327 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -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;
}