Skip to content

Add missing space between option help text and deprecation label#3423

Merged
kdeldycke merged 1 commit into
pallets:mainfrom
sjoubert:missing_space_deprecated_option
May 15, 2026
Merged

Add missing space between option help text and deprecation label#3423
kdeldycke merged 1 commit into
pallets:mainfrom
sjoubert:missing_space_deprecated_option

Conversation

@sjoubert
Copy link
Copy Markdown
Contributor

Without the space, a deprecated documented option currently appears as:
--deprecated-opt Old option(DEPRECATED[: too old])
After:
--deprecated-opt Old option (DEPRECATED[: too old])

@sjoubert sjoubert force-pushed the missing_space_deprecated_option branch from 63d18e6 to 61acdcc Compare May 13, 2026 13:59
@kdeldycke kdeldycke added this to the 8.4.0 milestone May 15, 2026
@kdeldycke kdeldycke added the docs label May 15, 2026
@kdeldycke
Copy link
Copy Markdown
Collaborator

Good catch. The other deprecated messages in Command.get_short_help_str and Command.format_help_text do introduce a space:

  • click/src/click/core.py

    Lines 1138 to 1145 in c943271

    if self.deprecated:
    localised_deprectated = _("deprecated").upper()
    deprecated_message = (
    f"({localised_deprectated}: {self.deprecated})"
    if isinstance(self.deprecated, str)
    else f"({localised_deprectated})"
    )
    text = f"{_(text)} {deprecated_message}"
  • click/src/click/core.py

    Lines 1174 to 1181 in c943271

    if self.deprecated:
    localised_deprectated = _("deprecated").upper()
    deprecated_message = (
    f"({localised_deprectated}: {self.deprecated})"
    if isinstance(self.deprecated, str)
    else f"({localised_deprectated})"
    )
    text = f"{_(text)} {deprecated_message}"

So this one is a legitimate inconsistency.

Now looking at that code maybe there is an opportunity for deduplicating code...

@kdeldycke kdeldycke added bug f:help feature: help text and removed docs labels May 15, 2026
@kdeldycke
Copy link
Copy Markdown
Collaborator

So this one is a legitimate inconsistency.

Now looking at that code maybe there is an opportunity for deduplicating code...

I will merge this simple bug fix, and think about the code deduplication later.

@kdeldycke kdeldycke merged commit 0039359 into pallets:main May 15, 2026
12 checks passed
@sjoubert sjoubert deleted the missing_space_deprecated_option branch May 15, 2026 10:54
@kdeldycke
Copy link
Copy Markdown
Collaborator

Now looking at that code maybe there is an opportunity for deduplicating code...

Good news, there is a real oportunity to deduplicate these messages. I proposed a PR at: #3430

kdeldycke added a commit to kdeldycke/click that referenced this pull request May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug f:help feature: help text

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants