2012-05-26 18:50:44 +00:00
|
|
|
from django.core.management.base import BaseCommand, CommandError
|
2007-09-21 16:19:20 +00:00
|
|
|
|
2011-10-13 18:04:12 +00:00
|
|
|
|
2007-09-21 16:19:20 +00:00
|
|
|
class Command(BaseCommand):
|
|
|
|
help = "Dance around like a madman."
|
|
|
|
args = ''
|
2014-01-20 02:45:21 +00:00
|
|
|
requires_system_checks = True
|
2007-09-21 16:19:20 +00:00
|
|
|
|
2014-06-06 20:39:33 +00:00
|
|
|
def add_arguments(self, parser):
|
|
|
|
parser.add_argument("-s", "--style", default="Rock'n'Roll")
|
|
|
|
parser.add_argument("-x", "--example")
|
2014-08-09 19:03:19 +00:00
|
|
|
parser.add_argument("--opt-3", action='store_true', dest='option3')
|
2009-04-05 17:27:26 +00:00
|
|
|
|
2007-09-21 16:19:20 +00:00
|
|
|
def handle(self, *args, **options):
|
2012-02-09 18:56:41 +00:00
|
|
|
example = options["example"]
|
2012-05-26 18:50:44 +00:00
|
|
|
if example == "raise":
|
|
|
|
raise CommandError()
|
2010-09-13 05:28:01 +00:00
|
|
|
self.stdout.write("I don't feel like dancing %s." % options["style"])
|
2014-08-09 19:03:19 +00:00
|
|
|
self.stdout.write(','.join(options.keys()))
|