[systemd-devel] [PATCH] journalctl: Allow to disable line cap with --pager-end
Jan Janssen
medhefgo at web.de
Sat Aug 30 06:26:05 PDT 2014
--lines=0 hardly makes sense with --pager-end, so give it some
new meaning.
---
man/journalctl.xml | 6 +++---
src/journal/journalctl.c | 12 ++++++++----
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/man/journalctl.xml b/man/journalctl.xml
index d4e0316..5c8d78c 100644
--- a/man/journalctl.xml
+++ b/man/journalctl.xml
@@ -189,9 +189,9 @@
that the pager will not buffer logs of
unbounded size. This may be overridden
with an explicit <option>-n</option>
- with some other numeric value on the
- command line. Note that this option is
- only supported for the
+ with some other numeric value while
+ <option>-n0</option> will disable this cap.
+ Note that this option is only supported for the
<citerefentry project='man-pages'><refentrytitle>less</refentrytitle><manvolnum>1</manvolnum></citerefentry>
pager.</para></listitem>
</varlistentry>
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 0aec5fb..49a6c23 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -326,10 +326,6 @@ static int parse_argv(int argc, char *argv[]) {
case 'e':
arg_pager_end = true;
-
- if (arg_lines < 0)
- arg_lines = 1000;
-
break;
case 'f':
@@ -642,6 +638,14 @@ static int parse_argv(int argc, char *argv[]) {
assert_not_reached("Unhandled option");
}
+
+ if (arg_pager_end) {
+ if (arg_lines < 0)
+ arg_lines = 1000;
+ else if (arg_lines == 0)
+ arg_lines = -1;
+ }
+
if (arg_follow && !arg_no_tail && arg_lines < 0)
arg_lines = 10;
--
2.1.0
More information about the systemd-devel
mailing list