* owner: nobody => marclurr
* status: new => assigned
* ui_ux: => 0
* easy: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/11407#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by marclurr):
Explanation of changes in command_parser.diff:
1. Modified _process_args on LaxOptionParser so that it doesn't catch the
SystemExit thrown by the exit() function
2. Modified print_help on LaxOptionParser to print the help message,
rather than doing nothing
3. Renamed LaxOptionParser to ManagementUtilityOptionParser, as it is
pretty specific to the management utility and isn't used anywhere else
4. Removed --version, --help and -h logic from ManagementUtility.execute
5. Removed exception handling for the call to LaxOptionParser.parse_args()
as it's only purpose seemed to be to catch SystemExit throw when --version
or --help are specified on the commandline, so allow the specific logic
below to run. Since this logic has now been removed the exception handling
is not required
--
Ticket URL: <https://code.djangoproject.com/ticket/11407#comment:4>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/11407#comment:5>
* needs_better_patch: 0 => 1
Comment:
This breaks the admin_scripts tests currently.
--
Ticket URL: <https://code.djangoproject.com/ticket/11407#comment:6>
* status: assigned => new
* needs_better_patch: 1 => 0
* owner: marclurr =>
Comment:
Just uploaded a new patch. It's somewhat similar to the one marclurr
posted, except I didn't rename the subclassed parser. All tests pass with
sqlite3.
--
Ticket URL: <https://code.djangoproject.com/ticket/11407#comment:7>
* keywords: => management django-admin.py manage.py
--
Ticket URL: <https://code.djangoproject.com/ticket/11407#comment:8>
Comment (by claudep):
After the partial rewrite needed by the conversion to `argparse` (#19973),
only the first "weirdness" partially subsists:
{{{
$ ./manage.py --version --help
Unknown command: '--version'
Type 'manage.py help' for usage.
}}}
or
{{{
$ ./manage.py --help --version
Unknown command: '--help'
Type 'manage.py help' for usage.
}}}
While individually using `--help` or `--version` produces the expected
output. Do we want to specifically support that sort of combination?
--
Ticket URL: <https://code.djangoproject.com/ticket/11407#comment:9>
* status: new => closed
* resolution: => fixed
Comment:
That wouldn't be a good use of your time. I don't see the use case for
asking for both help and version at the same time.
--
Ticket URL: <https://code.djangoproject.com/ticket/11407#comment:10>