mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Fixed #22985 -- Made call_command accept option name parameter
Thanks giulettamasina for the report and Tim Graham for the review.
This commit is contained in:
parent
8f9862cd4d
commit
2cc8ffe258
5 changed files with 48 additions and 6 deletions
|
@ -9,9 +9,11 @@ class Command(BaseCommand):
|
|||
def add_arguments(self, parser):
|
||||
parser.add_argument("-s", "--style", default="Rock'n'Roll")
|
||||
parser.add_argument("-x", "--example")
|
||||
parser.add_argument("--opt-3", action='store_true', dest='option3')
|
||||
|
||||
def handle(self, *args, **options):
|
||||
example = options["example"]
|
||||
if example == "raise":
|
||||
raise CommandError()
|
||||
self.stdout.write("I don't feel like dancing %s." % options["style"])
|
||||
self.stdout.write(','.join(options.keys()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue