aboutsummaryrefslogtreecommitdiffstats
path: root/src/argparser.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-08-27 23:15:41 +0200
committerMattias Andrée <maandree@operamail.com>2013-08-27 23:15:41 +0200
commitf5665923655e8743376969b27ddd8feee47eb84a (patch)
treec03ee02e9773e5a8a07c62b8fac795373c960341 /src/argparser.py
parentc fix (diff)
downloadargparser-f5665923655e8743376969b27ddd8feee47eb84a.tar.gz
argparser-f5665923655e8743376969b27ddd8feee47eb84a.tar.bz2
argparser-f5665923655e8743376969b27ddd8feee47eb84a.tar.xz
version common bugs
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/argparser.py11
1 files changed, 6 insertions, 5 deletions
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