
from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.core.template import TemplateManager

class TemplateCommand(BaseCommand):
    option_list = BaseCommand.option_list + (
        make_option(
            "-u",
            "--url",
            dest="url",
            default='default',
            help='Database router id.',
            metavar="DATABASE"
        ),
    )

    def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
        help = 'Template command help entry'
        parser = OptionParser(
            version=self.get_version(),
            option_list=self.get_option_list(),
            usage='\n  %prog {0} [OPTIONS] FILE...'.format(name)
        )
        aliases = ('tmp',)
        BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)

    def run(self, *args, **options):
        url = options.get('url')
        debug = options.get('debug')
        manger = TemplateManager()
        manger.list()
        print "Execute template {0}, {1}".format(url, debug)



from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.core.template import TemplateManager

class ListCommand(BaseCommand):

    def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
        help = 'Template command help entry'
        parser = OptionParser(
            version=self.get_version(),
            option_list=self.get_option_list(),
            usage='\n  %prog {0} [OPTIONS]'.format(name)
        )
        aliases = ('tmp',)
        BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)

    def run(self, *args, **options):
        manger = TemplateManager()
        manger.list()

    def get_default_option(self):
        return []

Remove options, the command does not take options.
ListCommand: Remove options, the command does not take options.

  
  from optparse import make_option
  from optparse import OptionParser
  from scaffolder.core.commands import BaseCommand
  from scaffolder.core.template import TemplateManager
  
- class TemplateCommand(BaseCommand):
+ class ListCommand(BaseCommand):
-     option_list = BaseCommand.option_list + (
-         make_option(
-             "-u",
-             "--url",
-             dest="url",
-             default='default',
-             help='Database router id.',
-             metavar="DATABASE"
-         ),
-     )
  
      def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
          help = 'Template command help entry'
          parser = OptionParser(
              version=self.get_version(),
              option_list=self.get_option_list(),
-             usage='\n  %prog {0} [OPTIONS] FILE...'.format(name)
+             usage='\n  %prog {0} [OPTIONS]'.format(name)
          )
          aliases = ('tmp',)
          BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)
  
      def run(self, *args, **options):
-         url = options.get('url')
-         debug = options.get('debug')
          manger = TemplateManager()
          manger.list()
-         print "Execute template {0}, {1}".format(url, debug)
  
+     def get_default_option(self):
+         return []
  
Remove options, the command does not take options.
## Code Before:

from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.core.template import TemplateManager

class TemplateCommand(BaseCommand):
    option_list = BaseCommand.option_list + (
        make_option(
            "-u",
            "--url",
            dest="url",
            default='default',
            help='Database router id.',
            metavar="DATABASE"
        ),
    )

    def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
        help = 'Template command help entry'
        parser = OptionParser(
            version=self.get_version(),
            option_list=self.get_option_list(),
            usage='\n  %prog {0} [OPTIONS] FILE...'.format(name)
        )
        aliases = ('tmp',)
        BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)

    def run(self, *args, **options):
        url = options.get('url')
        debug = options.get('debug')
        manger = TemplateManager()
        manger.list()
        print "Execute template {0}, {1}".format(url, debug)


## Instruction:
Remove options, the command does not take options.
## Code After:

from optparse import make_option
from optparse import OptionParser
from scaffolder.core.commands import BaseCommand
from scaffolder.core.template import TemplateManager

class ListCommand(BaseCommand):

    def __init__(self, name, help='', aliases=(), stdout=None, stderr=None):
        help = 'Template command help entry'
        parser = OptionParser(
            version=self.get_version(),
            option_list=self.get_option_list(),
            usage='\n  %prog {0} [OPTIONS]'.format(name)
        )
        aliases = ('tmp',)
        BaseCommand.__init__(self, name, parser=parser, help=help, aliases=aliases)

    def run(self, *args, **options):
        manger = TemplateManager()
        manger.list()

    def get_default_option(self):
        return []
