Replace optparse with argparse

This commit is contained in:
Dan Bright
2016-06-09 12:46:06 +01:00
parent d66209de29
commit 515447d999
+8 -8
View File
@@ -1,7 +1,4 @@
from optparse import make_option
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django_q import VERSION from django_q import VERSION
@@ -13,17 +10,20 @@ class Command(BaseCommand):
# Translators: help text for qinfo management command # Translators: help text for qinfo management command
help = _('General information over all clusters.') help = _('General information over all clusters.')
option_list = BaseCommand.option_list + ( def add_arguments(self, parser):
make_option('--config', parser.add_argument(
'--config',
action='store_true', action='store_true',
dest='config', dest='config',
default=False, default=False,
help='Print current configuration.'), help='Print current configuration.',
make_option('--ids', )
parser.add_argument(
'--ids',
action='store_true', action='store_true',
dest='ids', dest='ids',
default=False, default=False,
help='Print cluster task IDs (PIDs).'), help='Print cluster task ID(s) (PIDs).',
) )
def handle(self, *args, **options): def handle(self, *args, **options):