11# -*- coding: utf-8 -*-
22import os
33from distutils .dist import Distribution
4- from optparse import make_option
54from subprocess import call
65
76from django .core .management .base import LabelCommand , CommandError
@@ -15,23 +14,23 @@ class Command(LabelCommand):
1514
1615 args = '[makemessages] [compilemessages]'
1716
18- option_list = LabelCommand .option_list + (
19- make_option (
20- '--locale' , '-l' , default = None , dest = 'locale' , action = 'append' ,
17+ def add_arguments (self , parser ):
18+ super (Command , self ).add_arguments (parser )
19+ parser .add_argument (
20+ '--locale' , '-l' , default = [], dest = 'locale' , action = 'append' ,
2121 help = (
2222 'Creates or updates the message files for the given locale(s)'
2323 ' (e.g pt_BR). Can be used multiple times.'
2424 ),
25- ),
26- make_option (
25+ )
26+ parser . add_argument (
2727 '--domain' , '-d' , default = 'django' , dest = 'domain' ,
2828 help = 'The domain of the message files (default: "django").' ,
2929 ),
30- make_option (
30+ parser . add_argument (
3131 '--mapping-file' , '-F' , default = None , dest = 'mapping_file' ,
3232 help = 'Mapping file' ,
3333 )
34- )
3534
3635 def handle_label (self , command , ** options ):
3736 if command not in ('makemessages' , 'compilemessages' ):
0 commit comments