diff options
author | Nicolas Chauvat <nicolas.chauvat@logilab.fr> | 2009-07-19 02:07:55 +0200 |
---|---|---|
committer | Nicolas Chauvat <nicolas.chauvat@logilab.fr> | 2009-07-19 02:07:55 +0200 |
commit | a1cdde3320add8bbe4557639488bb4d2ef2861fd (patch) | |
tree | f579949c7a7fb9b4efb8a6ccdfcd35484854662b /optparser.py | |
parent | 6bb5a230a8df5ed2fe417c7b85491073da50dfd3 (diff) | |
download | logilab-common-a1cdde3320add8bbe4557639488bb4d2ef2861fd.tar.gz |
[cleanup] delete-trailing-whitespace
Diffstat (limited to 'optparser.py')
-rw-r--r-- | optparser.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/optparser.py b/optparser.py index 0b10124..2602a3c 100644 --- a/optparser.py +++ b/optparser.py @@ -18,7 +18,7 @@ With mymod.build that defines two functions run and add_options """ __docformat__ = "restructuredtext en" -# XXX merge with optik_ext ? merge with clcommands ? +# XXX merge with optik_ext ? merge with clcommands ? import sys import optparse @@ -29,7 +29,7 @@ class OptionParser(optparse.OptionParser): optparse.OptionParser.__init__(self, *args, **kwargs) self._commands = {} self.min_args, self.max_args = 0, 1 - + def add_command(self, name, mod_or_funcs, help=''): """name of the command name of module or tuple of functions (run, add_options) @@ -43,7 +43,7 @@ class OptionParser(optparse.OptionParser): print '\ncommands:' for cmdname, (_, help) in self._commands.items(): print '% 10s - %s' % (cmdname, help) - + def parse_command(self, args): if len(args) == 0: self.print_main_help() @@ -67,7 +67,7 @@ class OptionParser(optparse.OptionParser): else: run, add_options = mod_or_f add_options(self) - (options, args) = self.parse_args(args) + (options, args) = self.parse_args(args) if not (self.min_args <= len(args) <= self.max_args): self.error('incorrect number of arguments') return run, options, args |