Skip to content

tables in --argument help strings would be nice #2

@mdengler

Description

@mdengler

It would be nice if tables in help came out well:

    parser.add_argument(
        "--arg",
        help="""
            This same feature would be useful for arguments that would
            benefit from
            more explanation.

              1. It looks nicer
              2. It is easier to read, even if some of the bullets get to be a little long.
              3. Also, there is a table:
                 | Feature      | ParagraphFormatter | FlexiFormatter |
                 | :---         | :---:              | :---:          |
                 | Outputs text |        Yes         |       Yes      |
                 | Bullets?     |        Yes         |       Yes      |
                 | Tables       |        No          |       Yes      |
              4. Bullets can follow tables.

        """,  # noqa
    )

...should render like:

************************
Using the Flexi formatter
*************************

usage: flexidemo.py [-h] [--arg ARG]

optional arguments:
  -h, --help  show this help message and exit
  --arg ARG   This same feature would be useful for arguments that would benefit from more explanation.
               
                1. It looks nicer
                2. It is easier to read, even if some of the bullets get to be a little long.
                3. Also, there is a table:
                        | Feature      | ParagraphFormatter | FlexiFormatter |
                        | :---         | :---:              | :---:          |
                        | Outputs text |        Yes         |       Yes      |
                        | Bullets?     |        Yes         |       Yes      |
                        | Tables       |        No          |       Yes      |
                4. Bullets can follow tables.

This is a multi-paragraph epilog. It is presenting data that would benefit by being visually broken up into pieces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions