make pagination a toggle (#622)

This commit is contained in:
tamarrow
2016-05-24 13:20:42 -07:00
parent d376453a03
commit e88bffe306
2 changed files with 8 additions and 1 deletions

View File

@@ -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"

View File

@@ -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)