Make --vm command line option syntax consistent with other options.

This commit is contained in:
Paweł Bylica 2015-07-03 15:16:51 +02:00
parent f32f142e91
commit 09f0e7f644

View File

@ -728,10 +728,20 @@ Options::Options()
for (auto i = 0; i < argc; ++i)
{
auto arg = std::string{argv[i]};
if (arg == "--jit" || arg == "--vm=jit") // TODO: Remove deprecated option "--jit"
eth::VMFactory::setKind(eth::VMKind::JIT);
else if (arg == "--vm=smart")
eth::VMFactory::setKind(eth::VMKind::Smart);
if (arg == "--vm" && i + 1 < argc)
{
string vmKind = argv[++i];
if (vmKind == "interpreter")
VMFactory::setKind(VMKind::Interpreter);
else if (vmKind == "jit")
VMFactory::setKind(VMKind::JIT);
else if (vmKind == "smart")
VMFactory::setKind(VMKind::Smart);
else
cerr << "Unknown VM kind: " << vmKind << endl;
}
else if (arg == "--jit") // TODO: Remove deprecated option "--jit"
VMFactory::setKind(VMKind::JIT);
else if (arg == "--vmtrace")
vmtrace = true;
else if (arg == "--filltests")