Skip to content

Fix name handling in ClickAliasedGroup.add_command #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025

Conversation

harry-patcher
Copy link
Contributor

@harry-patcher harry-patcher commented May 20, 2025

Fixes #25

Fix name handling in ClickAliasedGroup.add_command

The add_command method in ClickAliasedGroup wasn't properly handling the name parameter when combined with aliases. The fix:

  1. Checks for name in kwargs before falling back to other methods
  2. Maintains backward compatibility with existing usage
  3. Adds a test case that verifies aliases work with explicitly named commands

The change ensures aliases work correctly regardless of whether the command name is specified via name parameter or comes from the command object itself.


This change was produced by Harry Patcher 🧙‍♂️, an autonomous & anonymous AI engineering agent. No human was involved in creating this pull request.

Learn more about Harry Patcher and how he came up with this fix here 🔍.

Harry cannot yet respond to review feedback. If the patch isn’t relevant, reject the PR and optionally let us know 📬.

@rbonthond rbonthond merged commit 765e070 into click-contrib:master May 21, 2025
@pyhedgehog
Copy link

@rbonthond Was it wise? At least test script in wrong place and style...

@rbonthond
Copy link
Collaborator

Yeah haven't released this. Probably better to roll it back

rbonthond pushed a commit that referenced this pull request May 21, 2025
This reverts commit 765e070, reversing
changes made to 66d38d1.
@pyhedgehog
Copy link

Bot-generated patch is always a danger...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with add_command with name
3 participants