summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2012-07-17 07:35:08 +0200
committerLennart Poettering <lennart@poettering.net>2012-07-17 17:20:58 +0200
commit92a1fd9e95954a557d6fe27b56f5ef1b89fc2f5e (patch)
tree58cce02cda2c254c7c7cfa54f98213d1a33ce04d /src/journal/journalctl.c
parent085d71209ba32c1e4e72ec031536be892054352e (diff)
journalctl: do not ellipsize when using pager
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.
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 016750c201..e9810c9a3d 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -312,6 +312,7 @@ int main(int argc, char *argv[]) {
bool need_seek = false;
sd_id128_t previous_boot_id;
bool previous_boot_id_valid = false;
+ bool have_pager;
log_parse_environment();
log_open();
@@ -397,7 +398,8 @@ int main(int argc, char *argv[]) {
goto finish;
}
- if (!arg_no_pager && !arg_follow) {
+ have_pager = !arg_no_pager && !arg_follow;
+ if (have_pager) {
columns();
pager_open();
}
@@ -410,6 +412,8 @@ int main(int argc, char *argv[]) {
for (;;) {
for (;;) {
sd_id128_t boot_id;
+ int flags = (arg_show_all*OUTPUT_SHOW_ALL |
+ have_pager*OUTPUT_FULL_WIDTH);
if (need_seek) {
r = sd_journal_next(j);
@@ -434,8 +438,7 @@ int main(int argc, char *argv[]) {
line ++;
- r = output_journal(j, arg_output, line, 0,
- arg_show_all ? OUTPUT_SHOW_ALL : 0);
+ r = output_journal(j, arg_output, line, 0, flags);
if (r < 0)
goto finish;