- GH-140,
PR-147
Add
rich_argparse.contrib
module to provide additional non-standard formatters. The new module currently contains a single formatterParagraphRichHelpFormatter
that preserves paragraph breaks (\n\n
) in the descriptions, epilog, and help text.
- GH-133, PR-135 Fix help preview generation with newer releases of rich.
- GH-130, PR-131 Fix a bug that caused long group titles to wrap.
- GH-125, GH-127, PR-128 Redesign metavar styling to fix broken colors of usage when some metavars are wrapped to multiple lines. The brackets and spaces of metavars are no longer colored.
- PR-124
Fix a regression in
%(default)s
style that was introduced in #123.
- PR-103 Python 3.13 is now officially supported
- GH-95, PR-103 Python 3.7 is no longer supported (EOL since 27/6/2023)
- GH-120,
GH-121,
PR-122
Add options
help_markup
andtext_markup
to disable console markup in the help text and the description text respectively.
- PR-90
Make
RichHelpFormatter
itself a rich renderable with rich console. - GH-91,
PR-92
Allow passing custom console to
RichHelpFormatter
. - GH-91,
PR-93
Add
HelpPreviewAction
to generate a preview of the help output in SVG, HTML, or TXT formats. - PR-97
Avoid importing
typing
to improve startup time by about 35%. - GH-84,
PR-98
Add a style for default values when using
%(default)s
in the help text. - PR-99 Allow arbitrary renderables in the descriptions and epilog.
- PR-87
Add
optparse.GENERATE_USAGE
to auto generate a usage similar to argparse. - PR-87
Add
rich_format_*
methods to optparse formatters. These return arich.text.Text
object.
- PR-73
Add experimental support for
optparse
. Import optparse formatters fromrich_argparse.optparse
.
- PR-72
The project now uses
ruff
for linting and import sorting. - PR-71
rich_argparse
is now a package instead of a module. This should not affect users.
- PR-74 Fix crash when a metavar following a long option contains control codes.
- GH-67,
PR-69
Fix
%
not being escaped properly - PR-68
Restore lazy loading of
rich
. Delay its import until it is needed.
- GH-55,
PR-56
Add a new style for
%(prog)s
in the usage. The style is applied in argparse-generated usage and in user defined usage whether the user usage is plain text or rich markup.
- GH-47,
PR-48
The default
group_name_formatter
has changed fromstr.upper
tostr.title
. This renders better with long group names and follows the convention of popular CLI tools and programs. Please note that if you test the output of your CLI verbatim and rely on the default behavior of rich_argparse, you will have to either set the formatter explicitly or update the tests.
- PR-43 Support type checking for users. Bundle type information in the wheel and sdist.
- PR-43 Fix annotations of class variables previously typed as instance variables.
- PR-38
Support console markup in custom
usage
messages. Note that this feature is not activated by default. To enable it, setRichHelpFormatter.usage_markup = True
.
- PR-35
Use
soft_wrap
inconsole.print
instead of a large fixed console width for wrapping - GH-36, PR-37 Fix a regression in highlight regexes that caused the formatter to crash when using the same style multiple times.
- PR-31
Add support for all help formatters of argparse. Now there are five formatter classes defined in
rich_argparse
:Note that this changes the default behavior ofRichHelpFormatter: the equivalent of argparse.HelpFormatter RawDescriptionRichHelpFormatter: the equivalent of argparse.RawDescriptionHelpFormatter RawTextRichHelpFormatter: the equivalent of argparse.RawTextHelpFormatter ArgumentDefaultsRichHelpFormatter: the equivalent of argparse.ArgumentDefaultsHelpFormatter MetavarTypeRichHelpFormatter: the equivalent of argparse.MetavarTypeHelpFormatter
RichHelpFormatter
to no longer respect line breaks in the description and help text. It now behaves similarly to the originalHelpFormatter
. You have now to use the appropriate subclass for this to happen.
- GH-16, PR-17 Fix inconsistent coloring of args in the top usage panel
- GH-12, PR-20 Fix incorrect line breaks that put metavars on a alone on a new line
- GH-19, PR-21 Do not print help output, return it instead
- PR-17 The default styles have been changed to be more in line with the new usage coloring
- PR-20
The default
max_help_position
is now set to 24 (the default used in argparse) as line breaks are no longer an issue
- PR-20
The
RichHelpFormatter.renderables
property has been removed, it was never documented
- PR-22 Run windows tests in CI
- GH-4, PR-10 Add missing ":" after the group name similar to the default HelpFormatter
- PR-11 Fix padding of long options or metavars
- PR-11 Fix overflow of text in help that was truncated
- PR-11 Escape parameters that get substituted with % such as %(prog)s and %(default)s
- PR-11 Fix flaky wrapping of long lines
- GH-5,
PR-6
Fix
RichHelpFormatter
does not replace%(prog)s
in text - GH-7, PR-8 Fix extra newline at the end
Initial release
- First upload to PyPI,
pip install rich-argparse
now supported