Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#15359 closed (fixed)

django-admin.py: -h option usage inconsistent with help output

Reported by: teubank Owned by: nobody
Component: Core (Management commands) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The help text for django-admin.py shows -h as a valid option, but using -h produces an error message. (This discrepancy is admittedly a very minor, but unnecessary, bug.)

To reproduce:

$ django-admin -h 
Unknown command: '-h'
Type 'django-admin help' for usage.
$ django-admin help
...
  -h, --help            show this help message and exit
...

The attached patches for releases 1.1.X and 1.2.X modify django/trunk/django/core/management/__init__.py to accept -h as a valid option.

-        elif self.argv[1:] == ['--help']:
+        elif self.argv[1:] == ['--help'] or self.argv[1:] == ['-h']:

Note: Since the definition for the help option is buried in optparse.py, modifying django/core/management/__init__.py to accept -h seems to be preferable to changing the help option definition to reflect current usage.

Attachments (2)

1.1.X.diff (604 bytes ) - added by teubank 13 years ago.
svn diff for version 1.1.X
1.2.X.diff (604 bytes ) - added by teubank 13 years ago.
svn diff for version 1.2.X

Download all attachments as: .zip

Change History (6)

by teubank, 13 years ago

Attachment: 1.1.X.diff added

svn diff for version 1.1.X

by teubank, 13 years ago

Attachment: 1.2.X.diff added

svn diff for version 1.2.X

comment:1 by Russell Keith-Magee, 13 years ago

milestone: 1.41.3
Triage Stage: UnreviewedReady for checkin

comment:2 by Russell Keith-Magee, 13 years ago

Resolution: fixed
Status: newclosed

In [15605]:

Fixed #15359 -- Ensure that the -h option is always honored by django-admin.py. Thanks to teubank for the report.

comment:3 by Russell Keith-Magee, 13 years ago

In [15609]:

[1.2.X] Fixed #15359 -- Ensure that the -h option is always honored by django-admin.py. Thanks to teubank for the report.

Backport of r15605 from trunk.

comment:4 by Jacob, 12 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top