lib: add pager functionality
Subsystems (2)
PATCH 1/3 lib: add pager functionality
From: Davidlohr Bueso <[email protected]>
When some program' output exceeds the terminal's dimensions, it is a nice feature to call a pager that acts as calling 'less' to allow better user navigation. This patch adds this functionality, based on what perf and git have (ie: git log).
Signed-off-by Davidlohr Bueso <[email protected]>
--- include/pager.h | 6 ++ lib/Makefile.am | 2 + lib/pager.c | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 222 insertions(+), 0 deletions(-) create mode 100644 include/pager.h create mode 100644 lib/pager.c
include/pager.h new file +6 -0
@@ -0,0 +1,6 @@ +#ifndef UTIL_LINUX_PAGER +#define UTIL_LINUX_PAGER + +void setup_pager (void ); + +#endif
lib/Makefile.am +2 -0
@@ -9,6 +9,7 @@ noinst_PROGRAMS = \ test_fileutils \ test_ismounted \ test_mangle \ + test_pager \ test_procutils \ test_strutils \ test_tt \
@@ -35,6 +36,7 @@ test_procutils_SOURCES = procutils.c if LINUX test_cpuset_SOURCES = cpuset.c test_sysfs_SOURCES = sysfs.c at.c +test_pager_SOURCES = pager.c test_sysfs_CFLAGS = -DTEST_PROGRAM_SYSFS test_loopdev_SOURCES = \
lib/pager.c new file +214 -0
214 lines not on this page · raw message
Signature · 1 line
1.7.4.1
Quoted 6 lines · Davidlohr Bueso
include/pager.h | 6 ++ lib/Makefile.am | 2 + lib/pager.c | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 222 insertions(+), 0 deletions(-) create mode 100644 include/pager.h create mode 100644 lib/pager.c
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com