add global --pager option

This commit is contained in:
The MMGen Project 2022-10-07 19:48:51 +00:00
commit 61857101fd
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 4 additions and 0 deletions

View file

@ -240,6 +240,7 @@ common_opts_data = {
--, --color=0|1 Disable or enable color output (enabled by default)
--, --columns=N Force N columns of output with certain commands
--, --force-256-color Force 256-color output when color is enabled
--, --pager Pipe output of certain commands to pager (WIP)
--, --data-dir=path Specify {pnm} data directory location
--, --daemon-data-dir=path Specify coin daemon data directory location
--, --daemon-id=ID Specify the coin daemon ID

View file

@ -601,6 +601,9 @@ def keypress_confirm(prompt,default_yes=False,verbose=False,no_nl=False,complete
else:
msg_r('\nInvalid reply\n' if verbose else '\r')
def stdout_or_pager(s):
(do_pager if opt.pager else Msg_r)(s)
def do_pager(text):
pagers = ['less','more']