mirror of
https://github.com/django/django.git
synced 2025-07-23 05:05:17 +00:00
Fixed #29295 -- Fixed management command crash when using subparsers.
Thanks Tim Graham for the fix.
This commit is contained in:
parent
21420096c4
commit
dd68b51e1d
4 changed files with 32 additions and 7 deletions
12
tests/user_commands/management/commands/subparser.py
Normal file
12
tests/user_commands/management/commands/subparser.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
|
||||
def add_arguments(self, parser):
|
||||
subparsers = parser.add_subparsers()
|
||||
parser_foo = subparsers.add_parser('foo')
|
||||
parser_foo.add_argument('bar', type=int)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
self.stdout.write(','.join(options))
|
Loading…
Add table
Add a link
Reference in a new issue