Skip to content

%(prog)s format specifier is not converted in description and epilog #130

@schlepuetz

Description

@schlepuetz

The %(prog)s format specifier of argparse does not seem to be picked up and replaced by the program name in the description and epilog arguments to argparse.

I frequently add usage examples in the epilog of the following form:

epilog = ('''
Examples:

* Run the script with the verbose option:

    %(prog)s -v
''')

This issue seems to have been partially addressed in Fix #27, and the solution works well for the help arguments of individual argument definitions, as well as the parser`s usage argument. However, it does not seem to be applied to the ```description``` and ```epilog```.

So it seems the solution already exists and would hopefully not be too difficult to extend to include description and epilog as well.

Thanks for a great Sphinx extension, by the way!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions