mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #30584 -- Fixed management command when using subparsers with dest parameter.
This commit is contained in:
committed by
Mariusz Felisiak
parent
f03b7bd114
commit
2b03e8e9e8
@@ -0,0 +1,13 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
def add_arguments(self, parser):
|
||||
subparsers_1 = parser.add_subparsers(dest='subcommand_1')
|
||||
parser_foo_1 = subparsers_1.add_parser('foo_1')
|
||||
subparsers_2 = parser_foo_1.add_subparsers(dest='subcommand_2')
|
||||
parser_foo_2 = subparsers_2.add_parser('foo_2')
|
||||
parser_foo_2.add_argument('--bar', required=True)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
self.stdout.write(','.join(options))
|
||||
Reference in New Issue
Block a user