]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: tweak 'list' output a bit
authorLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 15:05:14 +0000 (16:05 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 5 Mar 2019 15:50:58 +0000 (16:50 +0100)
Let's suppress the final newline in the list if it's the last entry we
are outputting.

src/boot/bootctl.c

index 1e0d115fe3ebbf6fee2e3555b3cbcb18d7530f2a..6c0885198add65ca8d90834d344188c047359ada 100644 (file)
@@ -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);