This is a patch against the Optik 1.5 release which
adds two minor -- but very helpful -- features to
First, it adds "preserve_whitespace" to HelpFormatter's
__init__(). It's meaning is opposite that of the
"replace_whitespace" in textwrap functions. (The
reversed name was chosen because the default is
preserve_whitespace=False, for backwards compatibility.
It would be trivial to reverse it back to
replace_whitespace by tweaking only the three __init__
functions in help.py, as that's where the reversal occurs.)
Second (and completely unrelated), HelpFormatter's
format_option_strings() suppresses an Option's metavar
if option.metavar=SUPPRESS_METAVAR. I've found this to
be useful in conjuction with complex callbacks or when
nargs > 1 (reduces clutter).
Log in to post a comment.