def print_args():
"""Prints out all command-line parameters."""
bg = terminal_bg()
if bg is True:
style = 'xcode'
elif bg is False:
style = 'monokai'
pprint = print_
try:
if bg is not None:
import pygments
from pygments.lexers import Python3Lexer
from pygments.formatters import Terminal256Formatter
pprint = partial(pygments.highlight, lexer=Python3Lexer(),
formatter=Terminal256Formatter(style=style), outfile=sys.stdout)
except ImportError:
pass
print_('Parameters:')
for key in sorted(ARGS):
v = repr(getattr(ARGS, key))
print_('% 14s: ' % key, end='')
pprint(v)
print_()
评论列表
文章目录