mirror of
https://github.com/Icinga/icinga2.git
synced 2025-04-08 17:05:25 +02:00
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();
|
||||
|
||||
if (lines.find(di.Path) != lines.end()) {
|
||||
std::cout << di.Path << ": " << lines[di.Path] << "\n";
|
||||
std::cout << String(di.Path.GetLength() + 2, ' ');
|
||||
int offset;
|
||||
|
||||
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";
|
||||
} else {
|
||||
ShowCodeFragment(std::cout, di);
|
||||
|
Loading…
x
Reference in New Issue
Block a user