Skip to content

Fix enum Choice shell completion using str() instead of name#3275

Closed
Hassad674 wants to merge 1 commit intopallets:mainfrom
Hassad674:fix/enum-choice-autocomplete
Closed

Fix enum Choice shell completion using str() instead of name#3275
Hassad674 wants to merge 1 commit intopallets:mainfrom
Hassad674:fix/enum-choice-autocomplete

Conversation

@Hassad674
Copy link

Fixes #3015

Choice.shell_complete() was using str() to convert choices to strings for completion, which produces 'MyEnum.foo' for enum members. The accepted CLI value however is 'foo' (the enum name), since normalize_choice uses choice.name for enums.

Changed shell_complete to use choice.name for enum members, matching the actual accepted input values. Added a test verifying enum completions use the name attribute.

@Rowlando13 Rowlando13 closed this Mar 20, 2026
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.

Choice autocomplete incorrect for enums

2 participants