aboutsummaryrefslogtreecommitdiffstats
path: root/vlib/vlib/unix/unix.h
diff options
context:
space:
mode:
authorChris Luke <chrisy@flirble.org>2016-04-25 13:49:22 -0400
committerDave Barach <openvpp@barachs.net>2016-04-27 13:32:49 +0000
commit7afda3aee55bb25a274c3d1da48589a82d8c6d3b (patch)
treec2845b574a7c7ffe863ef04d1d48c48fced2c719 /vlib/vlib/unix/unix.h
parent6b90fe323107b218019739ce8bb4429f83f218be (diff)
CLI output pager
Buffers output from CLI commands as it arrives and allows the terminal to view this buffer one page at a time. - View of the buffer is moved with space/enter/up/down/page-up/page-down/ home/end. - At the end of the CLI command if less than one page of output was generated then the pager is not engaged. - 'q' to quit the pager, or scroll off the bottom. - Pager prompt displays the current view aperture line numbers and total number of lines buffered. - Can be disabled at runtime with "no-cli-pager" in the unix configuration. - The number of lines that will be stored in the buffer is limited to prevent excessive memory use; this limit is configurable with "cli-pager-buffer-limit" in the unix configuration. - Both these options can also be set in the console with "set terminal pager [on|off] [limit <lines>]". Limitations: - Does not yet implement a search function. - Whilst the terminal size is detected and tracked, changing the terminal size when the pager is being used will not cause a redraw of the page. - Lines that wrap the right most column are not yet handled gracefully. Change-Id: I69548c1464eff79c53e122668f25758266daf1c2 Signed-off-by: Chris Luke <chrisy@flirble.org>
Diffstat (limited to 'vlib/vlib/unix/unix.h')
-rw-r--r--vlib/vlib/unix/unix.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/vlib/vlib/unix/unix.h b/vlib/vlib/unix/unix.h
index 20aec675ee0..2922b4e2a68 100644
--- a/vlib/vlib/unix/unix.h
+++ b/vlib/vlib/unix/unix.h
@@ -113,6 +113,12 @@ typedef struct {
/* Suppress the welcome banner at CLI session start */
int cli_no_banner;
+ /* Maximum pager buffer size */
+ u32 cli_pager_buffer_limit;
+
+ /* Suppress the pager */
+ int cli_no_pager;
+
/* Store the original state of stdin when it's a tty */
struct termios tio_stdin;
int tio_isset;