nhoffman / argparse-bash

Use python's argparse module in shell scripts
MIT License
166 stars 27 forks source link

Preserve newlines in description string of `ArgumentParser` #17

Closed catetrai closed 2 years ago

catetrai commented 2 years ago

This PR adds support for multiline description passed to ArgumentParser.

By default, argparse wraps the description text (i.e. replaces newlines with spaces).

To preserve newlines, I added the formatter_class option to ArgumentParser. See docs: https://docs.python.org/3/library/argparse.html?highlight=rawtexthelpformatter#argparse.RawDescriptionHelpFormatter

Thank you for this cool utility!

nhoffman commented 2 years ago

Thanks a lot for the contribution!