Permalink
Browse files

Change Command.create_parser() to take in args/kwargs to future proof…

… API and provide a better example for subclassing
  • Loading branch information...
1 parent f26b0ca commit c93456d64824a770dbd4c7c55b567d370656e74a @techniq techniq committed Sep 20, 2013
Showing with 2 additions and 6 deletions.
  1. +0 −3 flask_script/__init__.py
  2. +2 −3 flask_script/commands.py
@@ -158,9 +158,6 @@ def create_parser(self, prog, parents=None):
command_parser = command.create_parser(name, parents=[options_parser])
subparser = subparsers.add_parser(name, usage=description, help=description,
parents=[command_parser], add_help=False)
- # subparser.set_defaults(func_handle=command.handle)
- # if isinstance(command, Manager):
- # subparser.set_defaults(func_handle=self.foo)
## enable autocomplete only for parent parser when argcomplete is
@@ -112,10 +112,9 @@ def get_options(self):
"""
return self.option_list
- def create_parser(self, prog, parents=None):
+ def create_parser(self, *args, **kwargs):
- parser = argparse.ArgumentParser(prog=prog, parents=parents,
- description=self.description)
+ parser = argparse.ArgumentParser(*args, **kwargs)
for option in self.get_options():
if isinstance(option, Group):

0 comments on commit c93456d

Please sign in to comment.