#25264 closed Cleanup/optimization (fixed)
Misleading list of options available for manage.py commands
Reported by: | Maxime Lorant | Owned by: | Jan Szoja |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Jan Szoja | 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
Every commands has some options available, since the BaseCommand
initialize some options to the options parser: verbosity, settings, traceback..
However, this can be misleading, because these arguments are not used by every commands and sometimes this choice is by design. For example, the runserver
command does not use the verbosity
option, and it has been explained why only there: https://code.djangoproject.com/ticket/15132
I think the framework should not show generic options that are not used in the current commands (through an explicit list of generic options ignored or an explicit list of commands used ?)
Change History (22)
comment:1 by , 9 years ago
Summary: | Misleading → Misleading list of options available for manage.py commands |
---|
comment:2 by , 9 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Bug → Cleanup/optimization |
comment:3 by , 4 years ago
Easy pickings: | set |
---|
comment:4 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 3 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:6 by , 3 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
Can I have a look at and work on this ticket? This is my first contribution, but I'll try my best.
comment:7 by , 3 years ago
Here's the PR for this ticket: https://github.com/django/django/pull/14612
comment:8 by , 3 years ago
Has patch: | set |
---|
comment:9 by , 3 years ago
Patch needs improvement: | set |
---|
comment:10 by , 3 years ago
Has patch: | unset |
---|---|
Patch needs improvement: | unset |
comment:11 by , 3 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:12 by , 3 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
That sounds like a nice and easy ticket for the beginner like myself.
I will start with allowing setting argparse.SUPPRESS(as suggester in PR) in BaseCommand and possibly more advance way to tell which default commands are supported. Will see.
comment:13 by , 3 years ago
Cc: | added |
---|---|
Has patch: | set |
Pull Request awailable at:
https://github.com/django/django/pull/14694
I've added new attribute to BaseCommand class, which allows to disable any option/argument predefined in BaseCommand.create_parser.
All tests passed for admin_scripts.
comment:14 by , 3 years ago
Needs tests: | set |
---|---|
Patch needs improvement: | set |
comment:15 by , 3 years ago
Needs documentation: | set |
---|
comment:16 by , 3 years ago
Needs documentation: | unset |
---|---|
Needs tests: | unset |
comment:17 by , 3 years ago
Patch needs improvement: | unset |
---|
comment:18 by , 3 years ago
Easy pickings: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
I don't know that this is a big problem that is worth changing, but I guess if someone wants to propose a patch to fix the issue for
runserver
, we could entertain it. The documentation says these options are "available on all options" so this would require an update too. One consideration is that subclasses ofrunserver
might use these options (verbosity
most likely) so removing them by default would be backwards incompatible.