systemctl: ellipsize job list only when necessary, highlight running

I was debugging systemd waiting on a missing disk, and noticed
that the job listing could use some polishing. Jobs that are
actually running are highlighted, so it's easier to see what
very actually waiting for.

Also, the needed widths are precalculated, to use available columns
more ecomically.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2013-04-10 19:46:49 -04:00
parent b8a2b0f76b
commit 75add28aa1
2 changed files with 105 additions and 13 deletions
+7
View File
@@ -647,4 +647,11 @@ static inline bool logind_running(void) {
return access("/run/systemd/seats/", F_OK) >= 0;
}
static inline unsigned decimal_str_max(unsigned x) {
unsigned ans = 1;
while (x /= 10)
ans ++;
return ans;
}
int unlink_noerrno(const char *path);