Skip to content

Commit 98a190f

Browse files
committed
Convert runeffect to a Command
1 parent 0d7068a commit 98a190f

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

demosys/core/management/commands/runeffect.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@
22
Run a specific effect
33
"""
44
import demosys
5+
from demosys.core.management.base import CreateCommand
56

6-
HELP = "Runs an effect"
77

8+
class Command(CreateCommand):
9+
help = "Runs an effect"
810

9-
def print_usage():
10-
print("Usage:")
11-
print(" runeffect <effectname>")
11+
def add_arguments(self, parser):
12+
parser.add_argument("name", help="Name of the effect")
1213

13-
14-
def run(args):
15-
effect_name = args[0] if args else None
16-
if effect_name is None:
17-
print_usage()
18-
return
19-
20-
demosys.setup()
21-
demosys.run(runeffect=effect_name)
14+
def handle(self, *args, **options):
15+
demosys.setup()
16+
demosys.run(runeffect=options['name'])

0 commit comments

Comments
 (0)