Skip to content

AI junk - #3725

Closed
Cyriellewu wants to merge 1 commit into
pallets:mainfrom
Cyriellewu:metavar-multiple-ellipsis
Closed

AI junk#3725
Cyriellewu wants to merge 1 commit into
pallets:mainfrom
Cyriellewu:metavar-multiple-ellipsis

Conversation

@Cyriellewu

Copy link
Copy Markdown

Fixes #3652.

Problem

An option declared with multiple=True renders a metavar identical to a single-value option, so --help gives the user no signal that it can be repeated.

Cause

The base Parameter.make_metavar only appends ... when nargs != 1. multiple=True keeps nargs == 1, so the ellipsis was never added.

Fix

Append ... when self.multiple as well:

Options:
  --foo TEXT...  A list of foo strings.
  --bar TEXT     single
  --help         Show this message and exit.
```n
Scoped to the base `Parameter.make_metavar` (used by `Option`); `Argument` has its own override and already uses `nargs=-1` for repetition, so it's untouched.

## Tests

Added `test_multiple_option_metavar_ellipsis`. The full suite passes locally (1870 passed, no regressions); `ruff` is clean. CHANGES.md updated.

The base Parameter.make_metavar only appended '...' when nargs != 1, so an
option with multiple=True (which keeps nargs=1) rendered an identical metavar
to a single-value option. Append '...' when self.multiple as well, so help
output signals the option can be repeated (e.g. '--foo TEXT...').

Closes pallets#3652

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@davidism davidism closed this Jul 24, 2026
@davidism davidism changed the title Append ellipsis to option metavar when multiple=True (closes #3652) AI junk Jul 24, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 8, 2026
@kdeldycke kdeldycke added the rejected AI Contribution rejected because of its untrustworthy AI origin label Aug 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

rejected AI Contribution rejected because of its untrustworthy AI origin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants