Skip to content

Commit

Permalink
Implement support for removing more than one agent
Browse files Browse the repository at this point in the history
refs #7248
  • Loading branch information
gunnarbeutner committed Oct 24, 2014
1 parent c719333 commit 33b2395
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions lib/cli/agentremovecommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 33b2395

Please sign in to comment.