Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RichHelpFormatter does not replace %(prog)s in text #5

Closed
hamdanal opened this issue Sep 7, 2022 · 0 comments · Fixed by #6
Closed

RichHelpFormatter does not replace %(prog)s in text #5

hamdanal opened this issue Sep 7, 2022 · 0 comments · Fixed by #6
Labels
bug Something isn't working

Comments

@hamdanal
Copy link
Owner

hamdanal commented Sep 7, 2022

$ cat t.py
import argparse

from rich_argparse import RichHelpFormatter

parser = argparse.ArgumentParser(
    "awesome_program",
    description="This is the %(prog)s program.",
    formatter_class=RichHelpFormatter,
)
parser.add_argument("--version", action="version", version="%(prog)s 1.0.0")
parser.parse_args()
$ python t.py --version
%(prog)s 1.0.0
$ python t.py --help
usage: awesome_program [-h] [--version]

This is the %(prog)s program.

OPTIONS
  -h, --help  show this help message and exit
  --version   show program's version number and exit

Expected behaviour: replace %(prog)s by awesome_program in the printed text

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant