summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-03-07 20:44:35 +0100
committerLennart Poettering <lennart@poettering.net>2013-03-07 21:16:04 +0100
commit1b12a7b5896f94bdf33b3a6661ebabd761ea6adc (patch)
treec3ddd126dbf7e0b9267425a32bd656f04cf83383 /src/journal
parent6aa8d43ade72e24c9426e604f7fc4b7582b9db7c (diff)
pager: introduce "jump to end" option
$ journalctl -be is what you want :) https://bugzilla.redhat.com/show_bug.cgi?id=867841
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/coredumpctl.c2
-rw-r--r--src/journal/journalctl.c11
2 files changed, 10 insertions, 3 deletions
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index b6e558186..8bfab0075 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -560,7 +560,7 @@ int main(int argc, char *argv[]) {
case ACTION_LIST:
if (!arg_no_pager)
- pager_open();
+ pager_open(false);
r = dump_list(j);
break;
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index c90fecd23..5fb2db3ba 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -56,6 +56,7 @@
#define DEFAULT_FSS_INTERVAL_USEC (15*USEC_PER_MINUTE)
static OutputMode arg_output = OUTPUT_SHORT;
+static bool arg_pager_end = false;
static bool arg_follow = false;
static bool arg_full = false;
static bool arg_all = false;
@@ -103,6 +104,7 @@ static int help(void) {
" -u --unit=UNIT Show data only from the specified unit\n"
" --user-unit=UNIT Show data only from the specified user session unit\n"
" -p --priority=RANGE Show only messages within the specified priority range\n"
+ " -e --pager-end Immediately jump to end of the journal in the pager\n"
" -f --follow Follow journal\n"
" -n --lines[=INTEGER] Number of journal entries to show\n"
" --no-tail Show all lines, even in follow mode\n"
@@ -163,6 +165,7 @@ static int parse_argv(int argc, char *argv[]) {
{ "help", no_argument, NULL, 'h' },
{ "version" , no_argument, NULL, ARG_VERSION },
{ "no-pager", no_argument, NULL, ARG_NO_PAGER },
+ { "pager-end", no_argument, NULL, 'e' },
{ "follow", no_argument, NULL, 'f' },
{ "output", required_argument, NULL, 'o' },
{ "all", no_argument, NULL, 'a' },
@@ -199,7 +202,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "hfo:an::qmbD:p:c:u:F:xr", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "hefo:an::qmbD:p:c:u:F:xr", options, NULL)) >= 0) {
switch (c) {
@@ -216,6 +219,10 @@ static int parse_argv(int argc, char *argv[]) {
arg_no_pager = true;
break;
+ case 'e':
+ arg_pager_end = true;
+ break;
+
case 'f':
arg_follow = true;
break;
@@ -1075,7 +1082,7 @@ int main(int argc, char *argv[]) {
}
if (!arg_no_pager && !arg_follow)
- pager_open();
+ pager_open(arg_pager_end);
if (!arg_quiet) {
usec_t start, end;