Support positional arguments in management commands.

Review Request #10493 — Created April 2, 2019 and submitted

Information

Djblets
release-2.0.x

Reviewers

The compatibility layer for management commands tries to convert
new-style argument definitions to optparse on Django 1.6. However, one
major difference between the two is that argparse supports defining
positional arguments whereas optparse does not allow explicitly
defining these, instead leaving this up to the consuming command.

This change simply filters out the positional argument definitions when
using optparse, avoiding a crash. It still leaves the handling up to
the command, however, passing all positional arguments from the command
line.

Tested management commands defining positional arguments on both
Django 1.6 and 1.11.

Summary ID
Support positional arguments in management commands.
The compatibility layer for management commands tries to convert new-style argument definitions to `optparse` on Django 1.6. However, one major difference between the two is that `argparse` supports defining positional arguments whereas `optparse` does not allow explicitly defining these, instead leaving this up to the consuming command. This change simply filters out the positional argument definitions when using `optparse`, avoiding a crash. It still leaves the handling up to the command, however, passing all positional arguments from the command line.
e4b1a9495126048842709dcaa2a69f1762638df6
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (4fcb8f0)