diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-12-26 19:32:55 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-12-26 19:33:15 +0100 |
commit | 8937e7b68940d0fa0d0aab90eb7425fa7dccebc9 (patch) | |
tree | 05749fe0e97fe23b115448511e0662a4d8421313 /src | |
parent | 679829e4aa1461a2db7537aae4c68c6780362c06 (diff) |
machinectl: mark read-only images when listing in red
Diffstat (limited to 'src')
-rw-r--r-- | src/machine/machinectl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c index 64caf7c378..04e6cb9401 100644 --- a/src/machine/machinectl.c +++ b/src/machine/machinectl.c @@ -231,10 +231,10 @@ static int list_images(int argc, char *argv[], void *userdata) { for (j = 0; j < n_images; j++) { char crtime_buf[FORMAT_TIMESTAMP_MAX], mtime_buf[FORMAT_TIMESTAMP_MAX]; - printf("%-*s %-*s %-3s %-*s %-*s\n", + printf("%-*s %-*s %s%-3s%s %-*s %-*s\n", (int) max_name, images[j].name, (int) max_type, images[j].type, - yes_no(images[j].read_only), + images[j].read_only ? ansi_highlight_red() : "", yes_no(images[j].read_only), images[j].read_only ? ansi_highlight_off() : "", (int) max_crtime, images[j].crtime != 0 ? format_timestamp(crtime_buf, sizeof(crtime_buf), images[j].crtime) : "-", (int) max_mtime, images[j].mtime != 0 ? format_timestamp(mtime_buf, sizeof(mtime_buf), images[j].mtime) : "-"); } |