summaryrefslogtreecommitdiff
path: root/src/analyze
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-02-22 09:29:23 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-02-22 09:32:17 +0100
commitdeed4d50a2e437493d95be0f2e0b845222fff702 (patch)
treec11fa394614f608691ff5d9ee730fee5df947b72 /src/analyze
parent84653d99fa2d9539f5e2165e502cf66b2a6ebf4d (diff)
downloadsystemd-deed4d50a2e437493d95be0f2e0b845222fff702.tar.gz
analyze: add color highlighting when printing calendar elapses
With multiple iterations, I found it hard to pick out the interesting bits in the column of text. I tried plain highlighting first, but it doesn't seem enough. But blue/yellow makes it easy to jump to the right iteration.
Diffstat (limited to 'src/analyze')
-rw-r--r--src/analyze/analyze.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index 337089a40d..77adbed83d 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -1700,14 +1700,16 @@ static int test_calendar_one(usec_t n, const char *p) {
r = calendar_spec_next_usec(spec, n, &next);
if (r == -ENOENT) {
if (i == 0)
- printf(" Next elapse: never\n");
+ printf(" Next elapse: %snever%s\n",
+ ansi_highlight_yellow(), ansi_normal());
return 0;
}
if (r < 0)
return log_error_errno(r, "Failed to determine next elapse for '%s': %m", p);
if (i == 0)
- printf(" Next elapse: %s\n", format_timestamp(buffer, sizeof(buffer), next));
+ printf(" Next elapse: %s%s%s\n",
+ ansi_highlight_blue(), format_timestamp(buffer, sizeof(buffer), next), ansi_normal());
else {
int k = DECIMAL_STR_WIDTH(i+1);
@@ -1716,7 +1718,9 @@ static int test_calendar_one(usec_t n, const char *p) {
else
k = 0;
- printf("%*sIter. #%u: %s\n", k, "", i+1, format_timestamp(buffer, sizeof(buffer), next));
+ printf("%*sIter. #%u: %s%s%s\n",
+ k, "", i+1,
+ ansi_highlight_blue(), format_timestamp(buffer, sizeof(buffer), next), ansi_normal());
}
if (!in_utc_timezone())