CLICommandsLoader.create_command overrides the argument "arguments_loader"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 358
- Forks
- 101
- PR merge metrics
- No merged PRs in 30d
Description
Issue here: https://github.com/microsoft/knack/blob/dc7b7d857ce3c11b2a3155b81f2470b3b579e7c9/knack/commands.py#L265
The whole command registration process suggests that it is possible to give a custom arguments loader when calling the command method in a CommandGroup context. However, this parameter is overwritten with something else in the CLICommandsLoader.create_command method making impossible to pass a custom arguments_loader.
The same is true for the argument description_loader.
What was the behavior expected here? Shouldn't the arguments_loader from kwargs supersede the default one?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in knack/commands.py around CLICommandsLoader.create_command at the linked line, then trace how CommandGroup.command passes arguments_loader and description_loader. Confirm whether the supplied loaders are replaced during registration, and verify completion by covering custom-loader registration without breaking the default behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100