mirror of https://github.com/Icinga/icinga2.git
parent
d366dd8e30
commit
75d90d5963
|
@ -73,11 +73,16 @@ int ReplCommand::Run(const po::variables_map& vm, const std::vector<std::string>
|
|||
|
||||
expr = ConfigCompiler::CompileText("<console>", line);
|
||||
|
||||
bool has_errors = false;
|
||||
|
||||
BOOST_FOREACH(const ConfigCompilerMessage& message, ConfigCompilerContext::GetInstance()->GetMessages()) {
|
||||
if (message.Error)
|
||||
has_errors = true;
|
||||
|
||||
std::cout << (message.Error ? "Error" : "Warning") << ": " << message.Text << "\n";
|
||||
}
|
||||
|
||||
if (expr) {
|
||||
if (expr && !has_errors) {
|
||||
Value result = expr->Evaluate(frame);
|
||||
std::cout << ConsoleColorTag(Console_ForegroundCyan);
|
||||
if (!result.IsObject() || result.IsObjectType<Array>() || result.IsObjectType<Dictionary>())
|
||||
|
|
Loading…
Reference in New Issue