mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #25264 -- Allowed suppressing base command options in --help output.
This also suppresses -verbosity and --trackback options in the runserver's help.
This commit is contained in:
committed by
Mariusz Felisiak
parent
97f377cd35
commit
b667ac24ea
@@ -0,0 +1,24 @@
|
||||
from django.core.management import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
||||
help = 'Test suppress base options command.'
|
||||
requires_system_checks = []
|
||||
suppressed_base_arguments = {
|
||||
'-v',
|
||||
'--traceback',
|
||||
'--settings',
|
||||
'--pythonpath',
|
||||
'--no-color',
|
||||
'--force-color',
|
||||
'--version',
|
||||
'file',
|
||||
}
|
||||
|
||||
def add_arguments(self, parser):
|
||||
super().add_arguments(parser)
|
||||
self.add_base_argument(parser, 'file', nargs='?', help='input file')
|
||||
|
||||
def handle(self, *labels, **options):
|
||||
print('EXECUTE:SuppressBaseOptionsCommand options=%s' % sorted(options.items()))
|
||||
Reference in New Issue
Block a user