Implement support for removing more than one agent

refs #7248
This commit is contained in:
Gunnar Beutner 2014-10-24 12:16:14 +02:00
parent c719333b60
commit 33b2395ff0

View File

@ -60,10 +60,17 @@ int AgentRemoveCommand::Run(const boost::program_options::variables_map& vm, con
return 1; return 1;
} }
if (!AgentUtility::RemoveAgent(ap[0])) { bool failed = false;
Log(LogCritical, "cli", "Cannot remove agent '" + ap[0] + "'.");
return 1; BOOST_FOREACH(const String& agent, ap) {
if (!AgentUtility::RemoveAgent(agent)) {
Log(LogCritical, "cli", "Cannot remove agent '" + ap[0] + "'.");
failed = true;
}
} }
return 0; if (failed)
return 1;
else
return 0;
} }