Opened 10 years ago
Closed 7 years ago
#9158 closed (fixed)
django-admin.py print help to stderr
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Management commands) | Version: | 1.0 |
Severity: | Keywords: | ||
Cc: | Dario Ocles | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | UI/UX: |
Description
Command django-admin.py help print this text to stdout:
Usage: django-admin.py subcommand [options] [args] Options: --settings=SETTINGS The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used. --pythonpath=PYTHONPATH A directory to add to the Python path, e.g. "/home/djangoprojects/myproject". --traceback Print traceback on exception --version show program's version number and exit -h, --help show this help message and exit
and this text to stderr:
Type 'django-admin.py help <subcommand>' for help on a specific subcommand. Available subcommands: cleanup compilemessages createcachetable dbshell diffsettings dumpdata flush inspectdb loaddata makemessages reset runfcgi runserver shell sql sqlall sqlclear sqlcustom sqlflush sqlindexes sqlinitialdata sqlreset sqlsequencereset startapp startproject syncdb test testserver validate
It is quite illogical. And it is not possible to do something as it:
django-admin.py help | grep sql
(It is also useful if there are some custom commands with common prefix and I want their list.)
Attached patch replaces all four occurrences in django.core.management.init from stderr to stdout. But the first and the second are real errors, patch with only the third and the fourth change could be better.
Attachments (3)
Change History (8)
Changed 10 years ago by
Attachment: | django-admin-stdout.diff added |
---|
comment:1 Changed 9 years ago by
Triage Stage: | Unreviewed → Accepted |
---|
Changed 7 years ago by
Attachment: | django-admin-stdout2011.diff added |
---|
comment:2 Changed 7 years ago by
Cc: | Dario Ocles added |
---|
comment:3 Changed 7 years ago by
Patch needs improvement: | set |
---|
Changed 7 years ago by
Attachment: | django-admin-stdout_with_test.diff added |
---|
Print just help info to stdout, print real errors to stderr. Fixed tests
comment:4 Changed 7 years ago by
Patch needs improvement: | unset |
---|
The patch was outdated. I updated this to the latest version.