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
1 changed files with 11 additions and 4 deletions

View File

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