suppress_base_options_command.py 651 B

123456789101112131415161718192021222324
  1. from django.core.management import BaseCommand
  2. class Command(BaseCommand):
  3. help = 'Test suppress base options command.'
  4. requires_system_checks = []
  5. suppressed_base_arguments = {
  6. '-v',
  7. '--traceback',
  8. '--settings',
  9. '--pythonpath',
  10. '--no-color',
  11. '--force-color',
  12. '--version',
  13. 'file',
  14. }
  15. def add_arguments(self, parser):
  16. super().add_arguments(parser)
  17. self.add_base_argument(parser, 'file', nargs='?', help='input file')
  18. def handle(self, *labels, **options):
  19. print('EXECUTE:SuppressBaseOptionsCommand options=%s' % sorted(options.items()))