systemctl: do not print header if no units will be listed

"0 units listed." is still printed.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-05-07 11:35:34 -04:00
parent 0da999fada
commit 11690bcc50
+1 -1
View 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");