Paginate --help output
This commit is contained in:
parent
1d9b36996a
commit
fd49d17591
1 changed files with 8 additions and 3 deletions
11
kitty/cli.py
11
kitty/cli.py
|
|
@ -3,6 +3,7 @@
|
|||
# License: GPL v3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
|
||||
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from collections import deque
|
||||
|
||||
|
|
@ -10,7 +11,6 @@
|
|||
from .constants import appname, defconf, is_macos, str_version
|
||||
from .layout import all_layouts
|
||||
|
||||
|
||||
is_macos
|
||||
OPTIONS = '''
|
||||
--class
|
||||
|
|
@ -271,8 +271,13 @@ def wa(text, indent=0, leading_indent=None):
|
|||
t = opt['help'].replace('%default', str(opt.get('default')))
|
||||
wa(prettify(t), indent=4)
|
||||
|
||||
print('\n'.join(blocks))
|
||||
print('\n' + version())
|
||||
text = '\n'.join(blocks) + '\n\n' + version()
|
||||
if sys.stdout.isatty():
|
||||
p = subprocess.Popen(['less', '-isR'], stdin=subprocess.PIPE)
|
||||
p.communicate(text.encode('utf-8'))
|
||||
raise SystemExit(p.wait())
|
||||
else:
|
||||
print(text)
|
||||
|
||||
|
||||
def defval_for_opt(opt):
|
||||
|
|
|
|||
Loading…
Reference in a new issue