|
Zbigniew Jędrzejewski-Szmek |
126222 |
From 25bebb7cc2b1b0d4ffc9ed02c348ae96b49c4572 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Date: Sun, 6 Oct 2013 21:55:18 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
Subject: [PATCH] journalctl: flip to --full by default
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
We already shew lines in full when using a pager or not on a
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
tty. The commit disables ellipsization in the sole remaining case,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
namely when --follow is used.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
This has been a popular request for a long time, and indeed, full
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
output seems much more useful. Old behaviour can still be requested by
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
using --no-full. Old options retain their behaviour for compatiblity,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
but aren't advertised as much. This change applies only to jornalctl,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
not to systemctl, when ellipsization is useful to keep the layout.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
https://bugzilla.redhat.com/show_bug.cgi?id=984758
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
man/journalctl.xml | 15 ++++++++++++---
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
src/journal/journalctl.c | 12 +++++++++---
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
2 files changed, 21 insertions(+), 6 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/man/journalctl.xml b/man/journalctl.xml
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index d75c758..d1e841a 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/man/journalctl.xml
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/man/journalctl.xml
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -152,11 +152,20 @@
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
</varlistentry>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<varlistentry>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
- <term><option>-l</option></term>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <term><option>--no-full</option></term>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<term><option>--full</option></term>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <term><option>-l</option></term>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <listitem><para>Ellipsize fields when
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ they don't fit in available columns.
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ The default is to show full fields,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ allowing them to wrap or be truncated
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ by the pager if one is used.</para>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
- <listitem><para>Show all (printable) fields in
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
- full.</para></listitem>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <para>Old options
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <option>-l</option>/<option>--full</option>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ not useful anymore, except to undo
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ <option>--no-full</option>.</para></listitem>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
</varlistentry>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
<varlistentry>
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
index ccd96b2..1b5bdd3 100644
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
--- a/src/journal/journalctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+++ b/src/journal/journalctl.c
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -64,7 +64,7 @@
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static OutputMode arg_output = OUTPUT_SHORT;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static bool arg_pager_end = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static bool arg_follow = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
-static bool arg_full = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+static bool arg_full = true;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static bool arg_all = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static bool arg_no_pager = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
static int arg_lines = -1;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -187,7 +187,7 @@ static int help(void) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" short-precise, short-monotonic, verbose,\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" export, json, json-pretty, json-sse, cat)\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" -x --catalog Add message explanations where available\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
- " -l --full Do not ellipsize fields\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ " --no-full Ellipsize fields\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" -a --all Show all fields, including long and unprintable\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" -q --quiet Do not show privilege warning\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
" --no-pager Do not pipe output into a pager\n"
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -224,6 +224,7 @@ static int parse_argv(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
enum {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_VERSION = 0x100,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_NO_PAGER,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ ARG_NO_FULL,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_NO_TAIL,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_NEW_ID128,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
ARG_LIST_BOOTS,
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -258,6 +259,7 @@ static int parse_argv(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "output", required_argument, NULL, 'o' },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "all", no_argument, NULL, 'a' },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "full", no_argument, NULL, 'l' },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ { "no-full", no_argument, NULL, ARG_NO_FULL },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "lines", optional_argument, NULL, 'n' },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "no-tail", no_argument, NULL, ARG_NO_TAIL },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
{ "new-id128", no_argument, NULL, ARG_NEW_ID128 },
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -349,6 +351,10 @@ static int parse_argv(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
arg_full = true;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
break;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ case ARG_NO_FULL:
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ arg_full = false;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ break;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
case 'a':
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
arg_all = true;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
break;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
@@ -1736,7 +1742,7 @@ int main(int argc, char *argv[]) {
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
flags =
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
arg_all * OUTPUT_SHOW_ALL |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
- (arg_full || !on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
+ arg_full * OUTPUT_FULL_WIDTH |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
on_tty() * OUTPUT_COLOR |
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
arg_catalog * OUTPUT_CATALOG;
|
|
Zbigniew Jędrzejewski-Szmek |
126222 |
|