Fix --var=val arg handling.

--HG--
extra : convert_revision : 72d46faf9f7562f1c8d936d2e40729e6ca96e217
This commit is contained in:
Steve Reinhardt 2006-06-05 13:38:07 -04:00
parent 07a7de5e57
commit 6fa1146406

View file

@ -132,10 +132,11 @@ while args_left:
# of the format --<python var>=<string value>
try:
(var, val) = arg.split('=', 1)
var = var[2:]
except ValueError:
panic("Could not parse configuration argument '%s'\n"
"Expecting --<variable>=<value>\n" % arg);
eval("%s = %s" % (var, repr(val)))
exec "%s = %s" % (var, repr(val))
elif arg.startswith('-'):
# if the arg starts with '-', it should be a simulator option
# with a format similar to getopt.