Support positional arguments in management commands.
Review Request #10493 — Created April 2, 2019 and submitted
The compatibility layer for management commands tries to convert
new-style argument definitions to
optparseon Django 1.6. However, one
major difference between the two is that
positional arguments whereas
optparsedoes not allow explicitly
defining these, instead leaving this up to the consuming command.
This change simply filters out the positional argument definitions when
optparse, avoiding a crash. It still leaves the handling up to
the command, however, passing all positional arguments from the command
Tested management commands defining positional arguments on both
Django 1.6 and 1.11.