click icon indicating copy to clipboard operation
click copied to clipboard

Add help kwarg to argument parameter

Open Rowlando13 opened this issue 6 months ago • 2 comments

We are now open to a PR for adding a help kwarg to arguments in the same way that there is for options and adjusting the help pages to account for this.

Help Pages

@click.command()
@click.argument('name', help='The name to print')
@click.option('--count', default=1, help='number of greetings')
def hello(name: str, count: int):
    """This script prints hello and a name one or more times."""
    for x in range(count):
        if name:
            click.echo(f"Hello {name}!")
        else:
            click.echo("Hello!")

Rowlando13 avatar Jun 21 '25 05:06 Rowlando13

Hi! I'd love to work on this issue. Just to confirm: I should add a help= argument to click.argument(...) (in core.py), and then update the help formatter to display it, similar to how it's done for option(...)? If so, could I please be assigned? I'd like to give it a try.

KarinaNi avatar Jun 26 '25 09:06 KarinaNi

@KarinaNi Let's try the other issue first. It is a bit more approachable.

Rowlando13 avatar Jun 26 '25 23:06 Rowlando13