]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: shorter list-jobs --before/--after output a bit
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 17 Nov 2016 01:51:47 +0000 (20:51 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 17 Nov 2016 01:51:47 +0000 (20:51 -0500)
(before)$ systemctl list-jobs  --before --after
 JOB UNIT                                          TYPE  STATE
8769 foobar.device                                 start running
        A job waits for this job: 8669 (run-rb6da596d0cfa4e36b7c594cd973e795a.service/start)
8669 run-rb6da596d0cfa4e36b7c594cd973e795a.service start waiting
        This job waits for a job: 8769 (foobar.device/start)

2 jobs listed.

(after)$ systemctl list-jobs  --before --after
 JOB UNIT                                          TYPE  STATE
8769 foobar.device                                 start running
        waiting for job 8669 (run-rb6da596d0cfa4e36b7c594cd973e795a.service/start)
8669 run-rb6da596d0cfa4e36b7c594cd973e795a.service start waiting
        blocking job 8769 (foobar.device/start)

2 jobs listed.

src/systemctl/systemctl.c

index db836639b59cd353d2f775a157eccd096c9e5bd7..5fbda23775c8f1de009ea78c9d4d00abc2c34d25 100644 (file)
@@ -2227,7 +2227,7 @@ static void output_waiting_jobs(sd_bus *bus, uint32_t id, const char *method, co
         }
 
         while ((r = sd_bus_message_read(reply, "(usssoo)", &other_id, &name, &type, &state, &job_path, &unit_path)) > 0)
-                printf("%s%u (%s/%s)\n", prefix, other_id, name, type);
+                printf("%s %u (%s/%s)\n", prefix, other_id, name, type);
         if (r < 0) {
                 bus_log_parse_error(r);
                 return;
@@ -2309,9 +2309,9 @@ static void output_jobs_list(sd_bus *bus, const struct job_info* jobs, unsigned
                        on, state_len, j->state, off);
 
                 if (arg_jobs_after)
-                        output_waiting_jobs(bus, j->id, "GetJobAfter", "\tA job waits for this job: ");
+                        output_waiting_jobs(bus, j->id, "GetJobAfter", "\twaiting for job");
                 if (arg_jobs_before)
-                        output_waiting_jobs(bus, j->id, "GetJobBefore", "\tThis job waits for a job: ");
+                        output_waiting_jobs(bus, j->id, "GetJobBefore", "\tblocking job");
         }
 
         if (!arg_no_legend) {