From b2d8fe2a3f346ffaa021bae97fb85748f8cab1f0 Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Tue, 15 Jan 2019 10:32:56 +0100 Subject: [PATCH] F #2764: Add option no-pager, to disable pagination. (#2798) --- src/cli/cli_helper.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cli/cli_helper.rb b/src/cli/cli_helper.rb index b298599492..3d7e7f89b3 100644 --- a/src/cli/cli_helper.rb +++ b/src/cli/cli_helper.rb @@ -71,8 +71,18 @@ module CLIHelper :description => "Sets the delay in seconds for top command" } + NO_PAGER = { + :name => "no_pager", + :large => "--no-pager", + :format => String, + :description => "Disable pagination", + :proc => lambda { |o, options| + ENV['ONE_PAGER'] = 'cat' if File.exists?('/bin/cat') + } + } + #OPTIONS = [LIST, ORDER, FILTER, HEADER, DELAY] - OPTIONS = [LIST, LISTCONF, DELAY, FILTER, CSV_OPT] + OPTIONS = [LIST, LISTCONF, DELAY, FILTER, CSV_OPT, NO_PAGER] # Sets bold font def CLIHelper.scr_bold