Command line parser seems to be working
Converting string "integer" to actual integers here, seems like the right thing to do, but the string thing is stupid...will need to fix that
@@ -92,10 +92,10 @@ def cmdline():
#Iterate over list
if type(values) is list:
for val in values:
- #Chek for string entries
- field = val.split(' ')
#TODO: Any way to simplify init of these dicts?
if switch[1] in ('stdlib', 'macro', 'tool'):
+ #All these i
+ field = val.split(' ')
if field[0] not in cfg[param]:
cfg[param][field[0]]={}
if switch[2] not in cfg[param][field[0]].keys():
@@ -104,19 +104,17 @@ def cmdline():
if switch[2] not in cfg[param][field[0]][switch[2]].keys():
cfg[param][field[0]][switch[2]][field[1]]={}
cfg[param][field[0]][switch[2]][field[1]]['value'] = field[2]
+ else:
+ if field[1].isdigit():
+ cfg[param][field[0]][switch[2]]['value']= int(field[1])
else:
cfg[param][field[0]][switch[2]]['value']= field[1]
# Check for boolean switches that are true
else:
cfg[param] = val
- elif type(val) is bool:
- cfg[param] = values
else:
cfg[param] = values
- #Fancy reshuffling of fields to fit dictionary
-
-
return cfg
