summaryrefslogtreecommitdiff
path: root/src/systemctl
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-07 21:02:48 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-07 21:02:48 +0100
commit0d49cfa264e8afc52526cd0cd73b2309dff498b2 (patch)
treeebe305ba1ddf9157bd9417bd2115195b70770bce /src/systemctl
parentf8f14b3654bcd8d6c6cfd118e50775f6a2328a35 (diff)
systemctl: we show headers for list-units even when piped these days, hence do the same for list-jobs
Diffstat (limited to 'src/systemctl')
-rw-r--r--src/systemctl/systemctl.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index b75f335ae9..ad9d12548e 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -1258,12 +1258,11 @@ static void list_jobs_print(struct job_info* jobs, size_t n) {
shorten = true;
}
- if (on_tty())
- printf("%*s %-*s %-*s %-*s\n",
- l0, "JOB",
- l1, "UNIT",
- l2, "TYPE",
- l3, "STATE");
+ printf("%*s %-*s %-*s %-*s\n",
+ l0, "JOB",
+ l1, "UNIT",
+ l2, "TYPE",
+ l3, "STATE");
for (i = 0, j = jobs; i < n; i++, j++) {
_cleanup_free_ char *e = NULL;
@@ -1286,8 +1285,7 @@ static void list_jobs_print(struct job_info* jobs, size_t n) {
on = ansi_highlight();
off = ansi_highlight_off();
- if (on_tty())
- printf("\n%s%zu jobs listed%s.\n", on, n, off);
+ printf("\n%s%zu jobs listed%s.\n", on, n, off);
}
static int list_jobs(DBusConnection *bus, char **args) {