]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: do not print header if no units will be listed
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 25 Apr 2016 01:54:52 +0000 (21:54 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 7 May 2016 15:35:34 +0000 (11:35 -0400)
"0 units listed." is still printed.

src/systemctl/systemctl.c

index 75248c83b302fa4834cc912f2dc57acaf40567f5..639080bc66328da6e140f274bdda1fd2a76db749 100644 (file)
@@ -1355,7 +1355,7 @@ static void output_unit_file_list(const UnitFileList *units, unsigned c) {
         } else
                 id_cols = max_id_len;
 
-        if (!arg_no_legend)
+        if (!arg_no_legend && c > 0)
                 printf("%-*s %-*s\n",
                        id_cols, "UNIT FILE",
                        state_cols, "STATE");