mirror of https://github.com/Icinga/icinga2.git
console: Don't repeat line when we're reporting an error for the last line
fixes #8099
This commit is contained in:
parent
9dd0fba02f
commit
438e6dcd09
|
@ -110,8 +110,15 @@ int ConsoleCommand::Run(const po::variables_map& vm, const std::vector<std::stri
|
||||||
DebugInfo di = ex.GetDebugInfo();
|
DebugInfo di = ex.GetDebugInfo();
|
||||||
|
|
||||||
if (lines.find(di.Path) != lines.end()) {
|
if (lines.find(di.Path) != lines.end()) {
|
||||||
std::cout << di.Path << ": " << lines[di.Path] << "\n";
|
int offset;
|
||||||
std::cout << String(di.Path.GetLength() + 2, ' ');
|
|
||||||
|
if (di.Path != fileName) {
|
||||||
|
std::cout << di.Path << ": " << lines[di.Path] << "\n";
|
||||||
|
offset = 2;
|
||||||
|
} else
|
||||||
|
offset = 4;
|
||||||
|
|
||||||
|
std::cout << String(di.Path.GetLength() + offset, ' ');
|
||||||
std::cout << String(di.FirstColumn, ' ') << String(di.LastColumn - di.FirstColumn + 1, '^') << "\n";
|
std::cout << String(di.FirstColumn, ' ') << String(di.LastColumn - di.FirstColumn + 1, '^') << "\n";
|
||||||
} else {
|
} else {
|
||||||
ShowCodeFragment(std::cout, di);
|
ShowCodeFragment(std::cout, di);
|
||||||
|
|
Loading…
Reference in New Issue