diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-10-06 21:55:18 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-10-07 23:41:05 -0400 |
commit | 2b8f6883a17b9386299b7690869ccd8e20fe0347 (patch) | |
tree | 87443fac154486e081b00d56a19aadc7a1f607a1 | |
parent | c26547d612733371494330e26c7d3604a5dba3d9 (diff) |
journalctl: flip to --full by default
We already shew lines in full when using a pager or not on a
tty. The commit disables ellipsization in the sole remaining case,
namely when --follow is used.
This has been a popular request for a long time, and indeed, full
output seems much more useful. Old behaviour can still be requested by
using --no-full. Old options retain their behaviour for compatiblity,
but aren't advertised as much. This change applies only to jornalctl,
not to systemctl, when ellipsization is useful to keep the layout.
https://bugzilla.redhat.com/show_bug.cgi?id=984758
-rw-r--r-- | man/journalctl.xml | 15 | ||||
-rw-r--r-- | src/journal/journalctl.c | 12 |
2 files changed, 21 insertions, 6 deletions
diff --git a/man/journalctl.xml b/man/journalctl.xml index b5a0c539c..2ce81a056 100644 --- a/man/journalctl.xml +++ b/man/journalctl.xml @@ -154,7 +154,16 @@ <varlistentry> - <term><option>-l</option></term> + <term><option>--no-full</option></term> <term><option>--full</option></term> + <term><option>-l</option></term> + + <listitem><para>Ellipsize fields when + they don't fit in available columns. + The default is to show full fields, + allowing them to wrap or be truncated + by the pager if one is used.</para> - <listitem><para>Show all (printable) fields in - full.</para></listitem> + <para>Old options + <option>-l</option>/<option>--full</option> + not useful anymore, except to undo + <option>--no-full</option>.</para></listitem> </varlistentry> diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 9a2d25536..2f8be1b83 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -66,3 +66,3 @@ static bool arg_pager_end = false; static bool arg_follow = false; -static bool arg_full = false; +static bool arg_full = true; static bool arg_all = false; @@ -140,3 +140,3 @@ static int help(void) { " -x --catalog Add message explanations where available\n" - " -l --full Do not ellipsize fields\n" + " --no-full Ellipsize fields\n" " -a --all Show all fields, including long and unprintable\n" @@ -177,2 +177,3 @@ static int parse_argv(int argc, char *argv[]) { ARG_NO_PAGER, + ARG_NO_FULL, ARG_NO_TAIL, @@ -210,2 +211,3 @@ static int parse_argv(int argc, char *argv[]) { { "full", no_argument, NULL, 'l' }, + { "no-full", no_argument, NULL, ARG_NO_FULL }, { "lines", optional_argument, NULL, 'n' }, @@ -300,2 +302,6 @@ static int parse_argv(int argc, char *argv[]) { + case ARG_NO_FULL: + arg_full = false; + break; + case 'a': @@ -1624,3 +1630,3 @@ int main(int argc, char *argv[]) { arg_all * OUTPUT_SHOW_ALL | - (arg_full || !on_tty() || pager_have()) * OUTPUT_FULL_WIDTH | + arg_full * OUTPUT_FULL_WIDTH | on_tty() * OUTPUT_COLOR | |