Skip to content

Commit

Permalink
make pagination a toggle (#622)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamarrow committed May 24, 2016
1 parent d376453 commit e88bffe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions dcos/data/config-schema/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion dcos/emitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e88bffe

Please sign in to comment.