From f5665923655e8743376969b27ddd8feee47eb84a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 27 Aug 2013 23:15:41 +0200 Subject: version common bugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/argparser.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/argparser.py') diff --git a/src/argparser.py b/src/argparser.py index fcdad91..8f94c2e 100644 --- a/src/argparser.py +++ b/src/argparser.py @@ -283,20 +283,21 @@ class ArgParser(): argqueue.append(None) elif '=' in arg: arg_opt = arg[:arg.index('=')] + value = arg[arg.index('=') + 1:] if (arg_opt in self.optmap) and (self.optmap[arg_opt][1] >= ArgParser.ARGUMENTED): optqueue.append(arg_opt) - argqueue.append(arg[arg.index('=') + 1:]) + argqueue.append(value) if self.optmap[arg_opt][1] == ArgParser.VARIADIC: dashed = True self.optmap[arg_opt][2](arg_opt, self.optmap[arg_opt][0]) else: - self.optmap[arg_opt][2](arg_opt, self.optmap[arg_opt][0], argqueue[-1]) + self.optmap[arg_opt][2](arg_opt, self.optmap[arg_opt][0], value) else: - _arg = self.__abbreviations(arg) + _arg = self.__abbreviations(arg_opt) if _arg is None: - unrecognised(arg) + unrecognised(arg_opt) else: - queue[0:0] = [_arg] + queue[0:0] = ['%s=%s' % (_arg, value)] elif (arg in self.optmap) and (self.optmap[arg][1] <= ArgParser.OPTARGUMENTED): optqueue.append(arg) get += 1 -- cgit v1.2.3-70-g09d2