Commit 7ec44914 authored by Jelte Jansen's avatar Jelte Jansen

folded some long lines

parent a030bd71
......@@ -315,18 +315,23 @@ ModuleCCSession::checkCommand() {
if (target_module == module_name_) {
if (command_handler_) {
ElementPtr errors = Element::createList();
if (module_specification_.validate_command(cmd_str, arg, errors)) {
if (module_specification_.validate_command(cmd_str,
arg,
errors)) {
answer = command_handler_(cmd_str, arg);
} else {
std::stringstream ss;
ss << "Error in command validation: ";
BOOST_FOREACH(ConstElementPtr error, errors->listValue()) {
BOOST_FOREACH(ConstElementPtr error,
errors->listValue()) {
ss << error->stringValue();
}
answer = createAnswer(3, ss.str());
}
} else {
answer = createAnswer(1, "Command given but no command handler for module");
answer = createAnswer(1,
"Command given but no "
"command handler for module");
}
}
}
......
......@@ -190,7 +190,8 @@ ModuleSpec::validate_command(const std::string& command,
ConstElementPtr commands_spec = module_specification->find("commands");
if (args->getType() != Element::map) {
errors->add(Element::create("args for command " + command + " is not a map"));
errors->add(Element::create("args for command " +
command + " is not a map"));
return (false);
}
......@@ -202,7 +203,8 @@ ModuleSpec::validate_command(const std::string& command,
BOOST_FOREACH(ConstElementPtr cur_command, commands_spec->listValue()) {
if (cur_command->get("command_name")->stringValue() == command) {
return (validate_spec_list(cur_command->get("command_args"), args, true, errors));
return (validate_spec_list(cur_command->get("command_args"),
args, true, errors));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment