make pagination a toggle (#622)
This commit is contained in:
@@ -37,6 +37,12 @@
|
||||
"default": "false",
|
||||
"title": "SSL Verification",
|
||||
"description": "Whether to verify SSL certs for HTTPS or path to certs"
|
||||
},
|
||||
"pagination": {
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"title": "Pagination",
|
||||
"description": "Whether to paginate output"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
|
||||
@@ -172,7 +172,8 @@ def _page(output, pager_command=None):
|
||||
num_lines = output.count('\n')
|
||||
exceeds_tty_height = pager.getheight() - 1 < num_lines
|
||||
|
||||
if exceeds_tty_height:
|
||||
paginate = util.get_config().get("core.pagination", True)
|
||||
if exceeds_tty_height and paginate:
|
||||
pydoc.pipepager(output, cmd=pager_command)
|
||||
else:
|
||||
print(output)
|
||||
|
||||
Reference in New Issue
Block a user