From 92a1fd9e95954a557d6fe27b56f5ef1b89fc2f5e Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 17 Jul 2012 07:35:08 +0200 Subject: journalctl: do not ellipsize when using pager MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a pager is used, ellipsization is redundant — the pager does that better by hiding the part that cannot be shown. Pager's advantage is that the user can press → to view the hidden part of a message, and then ← to return. --- src/shared/logs-show.c | 3 ++- src/shared/logs-show.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/shared') diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index bbfb74c2bd..43e42f7880 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -225,7 +225,8 @@ static int output_short(sd_journal *j, unsigned line, unsigned n_columns, else if (!utf8_is_printable_n(message, message_len)) { char bytes[FORMAT_BYTES_MAX]; printf(": [%s blob data]\n", format_bytes(bytes, sizeof(bytes), message_len)); - } else if (message_len + n < n_columns) + } else if ((flags & OUTPUT_FULL_WIDTH) || + (message_len + n < n_columns)) printf(": %.*s\n", (int) message_len, message); else if (n < n_columns) { char *e; diff --git a/src/shared/logs-show.h b/src/shared/logs-show.h index 44afaf306a..2e9cf63891 100644 --- a/src/shared/logs-show.h +++ b/src/shared/logs-show.h @@ -44,6 +44,7 @@ typedef enum OutputFlags { OUTPUT_MONOTONIC_MODE = 1 << 1, OUTPUT_FOLLOW = 1 << 2, OUTPUT_WARN_CUTOFF = 1 << 3, + OUTPUT_FULL_WIDTH = 1 << 4, } OutputFlags; int output_journal(sd_journal *j, OutputMode mode, unsigned line, -- cgit v1.2.3-54-g00ecf