summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-26 19:32:55 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-26 19:33:15 +0100
commit8937e7b68940d0fa0d0aab90eb7425fa7dccebc9 (patch)
tree05749fe0e97fe23b115448511e0662a4d8421313
parent679829e4aa1461a2db7537aae4c68c6780362c06 (diff)
machinectl: mark read-only images when listing in red
-rw-r--r--src/machine/machinectl.c4
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) : "-");
}