Code

Opened 3 years ago

Closed 3 years ago

Last modified 3 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: UI/UX:

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 3 years ago.
svn diff for version 1.1.X
1.2.X.diff (604 bytes) - added by teubank 3 years ago.
svn diff for version 1.2.X

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by teubank

svn diff for version 1.1.X

Changed 3 years ago by teubank

svn diff for version 1.2.X

comment:1 Changed 3 years ago by russellm

  • milestone changed from 1.4 to 1.3
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 3 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

In [15605]:

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

comment:3 Changed 3 years ago by russellm

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 Changed 3 years ago by jacob

  • milestone 1.3 deleted

Milestone 1.3 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.