Skip to content

Allow interpolating values into getini help #9244

Description

@brandon-leapyear

What's the problem this feature will solve?

The help parameter to parser.addoption() allows interpolating other parameters in the help string, e.g.

parser.addoption("--foo", help="Foo, defaults to %(default)s", default="asdf")

It would be great if parser.addini() supported the same, e.g.

parser.addini("foo", help="Foo, defaults to %(default)s", default="asdf")

Alternative Solutions

One can manually interpolate, or just duplicate it

default = "asdf"
parser.addini("foo", help=f"Foo, defaults to {default}", default=default)

parser.addini("foo", help="Foo, defaults to asdf", default="asdf")

Additional context

https://docs.python.org/3/library/argparse.html#help

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: configrelated to config handling, argument parsing and config filetype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions