USI does not allow spaces in option names:
http://hgm.nubati.net/usi.html
Some GUIs seem to rely on that and do not display options containing
spaces, so spaces in option names are now replaced by underscores.
Closes #237.
if (Options.count(name))
Options[name] = value;
- else if (Options["Protocol"] == "ucci" && (std::replace(name.begin(), name.end(), '_', ' '), Options.count(name)))
+ // UCI dialects do not allow spaces
+ else if ( (Options["Protocol"] == "ucci" || Options["Protocol"] == "usi")
+ && (std::replace(name.begin(), name.end(), '_', ' '), Options.count(name)))
Options[name] = value;
else
sync_cout << "No such option: " << name << sync_endl;
if (it.second.idx == idx)
{
const Option& o = it.second;
- if (Options["Protocol"] == "ucci")
+ // UCI dialects do not allow spaces
+ if (Options["Protocol"] == "ucci" || Options["Protocol"] == "usi")
{
string name = it.first;
std::replace(name.begin(), name.end(), ' ', '_');
- os << "\noption " << name << " type " << o.type;
+ // UCCI skips "name"
+ os << "\noption " << (Options["Protocol"] == "ucci" ? "" : "name ") << name << " type " << o.type;
}
else
os << "\noption name " << it.first << " type " << o.type;