Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only add 'args' argument once to command parser.
If a custom management LabelCommand or AppCommand uses 'args' then only the last positional argument provided is passed to the command, because argparse's behaviour when two calls to add_argument with the same name is undefined (it appears to put all the arguments bar one in the first '*' argument, then the last one in the '+' argument). This shows this with a test, and fixes it by not making the first call to parser.add_argument('args') if it's a LabelCommand or AppCommand.
- Loading branch information
Showing
2 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters