From db5458a5074a3aa82a5a2fcc1e3e9916b0ab5526 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Sun, 28 Jun 2009 09:57:05 +0000 Subject: [PATCH] bug fix: reenable the -d option svn: r12722 --- src/cli/argparser.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cli/argparser.py b/src/cli/argparser.py index 048ffdf55..6d1807778 100644 --- a/src/cli/argparser.py +++ b/src/cli/argparser.py @@ -173,6 +173,7 @@ class ArgParser(object): return # Go over all given option and place them into appropriate lists + cleandbg = [] for opt_ix in range(len(options)): option, value = options[opt_ix] if option in ( '-O', '--open'): @@ -200,8 +201,10 @@ class ArgParser(object): options_str = options[opt_ix+1][1] self.actions.append((action, options_str)) elif option in ('-d', '--debug'): + print 'setup debugging', value logger = logging.getLogger(value) logger.setLevel(logging.DEBUG) + cleandbg += [opt_ix] elif option in ('-l',): self.list = True elif option in ('-L',): @@ -211,6 +214,11 @@ class ArgParser(object): elif option in ('-u', '--force-unlock'): self.force_unlock = True + #clean options list + cleandbg.reverse() + for ind in cleandbg: + del options[ind] + if len(options) > 0 and self.open is None and self.imports == [] \ and not (self.list or self.list_more or self.help): self.errors += [(_('Error parsing the arguments'),