summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-24 21:54:52 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-05-07 11:35:34 -0400
commit11690bcc5051e777ff2ff78e5bd6c089c6bd8aba (patch)
tree60104e7e604d7b1d0a81ad0e9e3f364ca09b68f0
parent0da999fada225d2d74b62ec758cd437a3e2f6ebb (diff)
systemctl: do not print header if no units will be listed
"0 units listed." is still printed.
-rw-r--r--src/systemctl/systemctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 75248c83b3..639080bc66 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -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");