chiark / gitweb /
unit: print the color status marks on the left
authorMichal Schmidt <mschmidt@redhat.com>
Mon, 14 May 2012 10:50:33 +0000 (12:50 +0200)
committerMichal Schmidt <mschmidt@redhat.com>
Mon, 14 May 2012 12:29:53 +0000 (14:29 +0200)
commit9ab7a8d2a30f440c008d127113419030e4572cb4
treed7e8f92fe9aad4c5ed4bca5d5e00ee5d6805b8b8
parent5f23d5b149513d98bb90df8cb912b6f567bed89f
unit: print the color status marks on the left

The alignment of the "[  OK  ]" and "[FAILED]" status marks to the right
side of the terminal makes it difficult to link them with the messages
on the left if your console is wide.

I considered the options:
 1. Align them to the 80th column regardless of the console width.
    Disadvantage - either:
    - truncating messages needlessly, not using available space; or
    - If the message is long, write the mark over it. => ugly
 2. Write them to the 80th column for short messages,
    and further to the right for longer ones.
    Disadvantage:
    - jagged look
 3. Write the marks on the left, before the message.
    Disadvantage:
    - Breaks tradition from RHL.
    Advantages:
    + slightly simpler code
    + Will annoy holy-traditionalists.

I chose option 3.
BTW, Debian now uses similar marks on the left with its makefile-style
boot.

Special values of the "status" argument to status_vprintf are:
  NULL - no status mark, no message indentation
  ""   - no status mark, message indented as if the mark was there
src/core/unit.c
src/shared/util.c