homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author daves
Recipients GraylinKim, bethard, daves, denilsonsa, eric.araujo, jwilk, paul.j3, perette, rurpy2, ssokolow, zbysz
Date 2020年09月07日.14:10:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1599487810.45.0.35665459935.issue12806@roundup.psfhosted.org>
In-reply-to
Content
I've submitted FlexiHelpFormatter as PR22129.
This adds the FlexiHelpFormatter class to argparse.
It supports wrapping text, while preserving paragraphs. Bullet lists are supported.
There are a number of differences, relative to the latest patch in the issue report:
 - single line feeds in a paragraph are allowed
 - the code is refactored to avoid duplication
 - test failure fixes (mostly whitespace)
 - Tests and documentation are included.
 >>> parser = argparse.ArgumentParser(
 ... prog='PROG',
 ... formatter_class=argparse.FlexiHelpFormatter,
 ... description="""
 ... The FlexiHelpFormatter will wrap text within paragraphs
 ... when required to in order to make the text fit.
 ...
 ... Paragraphs are preserved.
 ...
 ... It also supports bulleted lists in a number of formats:
 ... * stars
 ... 1. numbers
 ... - ... and so on
 ... """)
 >>> parser.add_argument(
 ... "argument",
 ... help="""
 ... Argument help text also supports flexible formatting,
 ... with word wrap:
 ... * See?
 ... """)
 >>> parser.print_help()
 usage: PROG [-h] option
 The FlexiHelpFormatter will wrap text within paragraphs when required to in
 order to make the text fit.
 Paragraphs are preserved.
 It also supports bulleted lists in a number of formats:
 * stars
 1. numbers
 - ... and so on
 positional arguments:
 argument Argument help text also supports flexible formatting, with word
 wrap:
 * See?
 optional arguments:
 -h, --help show this help message and exit
History
Date User Action Args
2020年09月07日 14:10:10davessetrecipients: + daves, bethard, ssokolow, jwilk, eric.araujo, zbysz, denilsonsa, rurpy2, GraylinKim, paul.j3, perette
2020年09月07日 14:10:10davessetmessageid: <1599487810.45.0.35665459935.issue12806@roundup.psfhosted.org>
2020年09月07日 14:10:10daveslinkissue12806 messages
2020年09月07日 14:10:10davescreate

AltStyle によって変換されたページ (->オリジナル) /