summaryrefslogtreecommitdiff
path: root/src/boot/bootctl.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-03-01 16:05:14 +0100
committerLennart Poettering <lennart@poettering.net>2019-03-05 16:50:58 +0100
commit4629499e7fed6b67e03aa202da1e757160d63582 (patch)
tree79cd2688f83852d2496dc4902e6a1b3c5a346ea7 /src/boot/bootctl.c
parente667266a74d7bb3edab43ad63b5de76c6915e6b7 (diff)
downloadsystemd-4629499e7fed6b67e03aa202da1e757160d63582.tar.gz
bootctl: tweak 'list' output a bit
Let's suppress the final newline in the list if it's the last entry we are outputting.
Diffstat (limited to 'src/boot/bootctl.c')
-rw-r--r--src/boot/bootctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index 1e0d115fe3..6c0885198a 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -1214,7 +1214,8 @@ static int verb_list(int argc, char *argv[], void *userdata) {
if (r < 0)
return r;
- puts("");
+ if (n+1 < config.n_entries)
+ putchar('\n');
strv_remove(found_by_loader, config.entries[n].id);
}
@@ -1223,7 +1224,7 @@ static int verb_list(int argc, char *argv[], void *userdata) {
if (!strv_isempty(found_by_loader)) {
char **i;
- printf("Automatic/Other Entries Found by Boot Loader:\n\n");
+ printf("\nAutomatic/Other Entries Found by Boot Loader:\n\n");
STRV_FOREACH(i, found_by_loader)
puts(*i);