pallets / pallets/click

Automatically append ellipsis (`...`) to metavars when `multiple=True` in options

Open Beginner friendly
#3,652 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help output
Dominant language
Python
Stars
17.7k
Forks
2.3k
Avg merge
1d 30m
Merged PRs (30d)
18

Description

When building a command-line interface with click.option(..., multiple=True), the auto-generated usage string does not visually signal to the user that the option can be repeated. For instance, an option --foo=FOO looks identical whether it accepts single or multiple arguments. This is different from the common convention for multi-value items in shell interfaces often suggests adding an ellipsis like --foo=FOO...

Expected behavior if option "foo" has multiple=True:

Usage: script.py [OPTIONS]

Options:
  --foo TEXT...  A list of foo strings.
  --help         Show this message and exit.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Trace Click's auto-generated option usage string for an option configured with multiple=True, comparing it with the single-value case. Add regression coverage for the expected --foo TEXT... output and verify that ordinary options remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.