route renamed reset sub-commands through Deprecated class to print warning
This commit is contained in:
@ -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]);
|
||||
|
||||
@ -20,6 +20,9 @@ CommandStyle(kim_interactions,Deprecated);
|
||||
CommandStyle(kim_param,Deprecated);
|
||||
CommandStyle(kim_property,Deprecated);
|
||||
CommandStyle(kim_query,Deprecated);
|
||||
CommandStyle(reset_atom_ids,Deprecated);
|
||||
CommandStyle(reset_image_flags,Deprecated);
|
||||
CommandStyle(reset_mol_ids,Deprecated);
|
||||
CommandStyle(message,Deprecated);
|
||||
CommandStyle(server,Deprecated);
|
||||
// clang-format on
|
||||
|
||||
@ -2003,7 +2003,7 @@ void Input::units()
|
||||
|
||||
int Input::meta(const std::string &prefix)
|
||||
{
|
||||
auto mycmd = fmt::format("{}_{}", prefix, arg[0]);
|
||||
auto mycmd = fmt::format("{}_{}", utils::uppercase(prefix), utils::uppercase(arg[0]));
|
||||
if (command_map->find(mycmd) != command_map->end()) {
|
||||
CommandCreator &command_creator = (*command_map)[mycmd];
|
||||
Command *cmd = command_creator(lmp);
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
#ifdef COMMAND_CLASS
|
||||
// clang-format off
|
||||
CommandStyle(reset_atom_ids,ResetIDs);
|
||||
CommandStyle(RESET_ATOM_IDS,ResetIDs);
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
#ifdef COMMAND_CLASS
|
||||
// clang-format off
|
||||
CommandStyle(reset_image_flags,ResetImageFlags);
|
||||
CommandStyle(RESET_IMAGE_FLAGS,ResetImageFlags);
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
|
||||
#ifdef COMMAND_CLASS
|
||||
// clang-format off
|
||||
CommandStyle(reset_mol_ids,ResetMolIDs);
|
||||
CommandStyle(RESET_MOL_IDS,ResetMolIDs);
|
||||
// clang-format on
|
||||
#else
|
||||
|
||||
|
||||
Reference in New Issue
Block a user