route renamed reset sub-commands through Deprecated class to print warning

This commit is contained in:
Axel Kohlmeyer
2022-11-17 23:11:41 -05:00
parent 7e9d66bbfb
commit e8471790bc
6 changed files with 23 additions and 9 deletions

View File

@ -34,14 +34,25 @@ void Deprecated::command(int narg, char **arg)
return;
} else if (cmd == "reset_ids") {
if (lmp->comm->me == 0)
utils::logmesg(lmp, "\n'reset_ids' has been renamed to 'reset_atom_ids'\n\n");
utils::logmesg(lmp, "\n'reset_ids' has been renamed to 'reset atom_ids'\n\n");
} else if (utils::strmatch(cmd, "^kim_")) {
if (lmp->comm->me == 0)
utils::logmesg(lmp,
"\nWARNING: 'kim_<command>' has been renamed to 'kim <command>'. "
"Please update your input.\n\n");
std::string newcmd("kim");
newcmd += " " + cmd.substr(4);
if (lmp->comm->me == 0)
utils::logmesg(lmp, "\nWARNING: '{}' has been renamed to '{}'. Please update your input.\n\n",
cmd, newcmd);
for (int i = 0; i < narg; ++i) {
newcmd.append(1, ' ');
newcmd.append(arg[i]);
}
input->one(newcmd);
return;
} else if (utils::strmatch(cmd, "^reset_")) {
std::string newcmd("reset");
newcmd += " " + cmd.substr(6);
if (lmp->comm->me == 0)
utils::logmesg(lmp, "\nWARNING: '{}' has been renamed to '{}'. Please update your input.\n\n",
cmd, newcmd);
for (int i = 0; i < narg; ++i) {
newcmd.append(1, ' ');
newcmd.append(arg[i]);