summaryrefslogtreecommitdiff
path: root/src/shared
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/shared
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/shared')
-rw-r--r--src/shared/pager.c7
-rw-r--r--src/shared/pager.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/shared/pager.c b/src/shared/pager.c
index 5165d2b1c8..4ffb530e93 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -44,7 +44,7 @@ _noreturn_ static void pager_fallback(void) {
_exit(EXIT_SUCCESS);
}
-int pager_open(void) {
+int pager_open(bool jump_to_end) {
int fd[2];
const char *pager;
pid_t parent_pid;
@@ -85,7 +85,10 @@ int pager_open(void) {
dup2(fd[0], STDIN_FILENO);
close_pipe(fd);
- setenv("LESS", "FRSXK", 0);
+ if (jump_to_end)
+ setenv("LESS", "FRSXK+G", 0);
+ else
+ setenv("LESS", "FRSXK", 0);
/* Make sure the pager goes away when the parent dies */
if (prctl(PR_SET_PDEATHSIG, SIGTERM) < 0)
diff --git a/src/shared/pager.h b/src/shared/pager.h
index 5e7b5ab91e..325ca98f79 100644
--- a/src/shared/pager.h
+++ b/src/shared/pager.h
@@ -23,6 +23,6 @@
#include <stdbool.h>
-int pager_open(void);
+int pager_open(bool jump_to_end);
void pager_close(void);
bool pager_have(void);