Don't ignore unknown options, don't execute the command instead.

This commit is contained in:
Tomasz Sobczyk
2021-05-17 11:35:36 +02:00
parent 201d324187
commit ddcfaa06fa
3 changed files with 18 additions and 2 deletions

View File

@@ -896,7 +896,10 @@ namespace Stockfish::Tools
params.ensure_quiet = true;
}
else
cout << "ERROR: Ignoring unknown option " << token << endl;
{
cout << "ERROR: Unknown option " << token << ". Exiting...\n";
return;
}
}
if (!sfen_format.empty())

View File

@@ -443,7 +443,10 @@ namespace Stockfish::Tools
UCI::setoption("EnableTranspositionTable", "true");
}
else
cout << "ERROR: Ignoring unknown option " << token << endl;
{
cout << "ERROR: Unknown option " << token << ". Exiting...\n";
return;
}
}
if (!sfen_format.empty())

View File

@@ -210,6 +210,11 @@ namespace Stockfish::Tools
is >> params.input_filename;
else if (token == "output_file")
is >> params.output_filename;
else
{
std::cout << "ERROR: Unknown option " << token << ". Exiting...\n";
return;
}
}
std::cout << "Performing transform nudged_static with parameters:\n";
@@ -474,6 +479,11 @@ namespace Stockfish::Tools
is >> params.keep_moves;
else if (token == "research_count")
is >> params.research_count;
else
{
std::cout << "ERROR: Unknown option " << token << ". Exiting...\n";
return;
}
}
params.enforce_constraints();