Commit b2704760 authored by aggsol's avatar aggsol 🙉

better messages and checks

parent 827eb235
......@@ -44,7 +44,7 @@ int main(int argc, char* argv[])
std::ifstream file(input);
if(not file.is_open())
{
throw std::runtime_error("Cannot load " + input);
throw std::runtime_error("Error : Cannot load " + input);
}
std::map<int, bodhi::Section> sections;
......@@ -61,7 +61,7 @@ int main(int argc, char* argv[])
}
catch(const std::exception& ex)
{
std::cerr << "Error in line:" << lineCounter << ":" << ex.what() << "\n";
std::cerr << "Error : Line: " << lineCounter << ":" << ex.what() << "\n";
return 101;
}
lineCounter++;
......@@ -79,7 +79,8 @@ int main(int argc, char* argv[])
}
else
{
std::cerr << "Error: Missing sections: " << child << "\n";
std::cerr << "Error : Missing section: " << child
<< " linked from section: " << s.first << "\n";
}
}
}
......@@ -92,7 +93,12 @@ int main(int argc, char* argv[])
{
if(s.first - last != 1)
{
std::cerr << "Warning: Missing section: " << s.first - 1 "\n";
std::cerr << "Warning: Missing section(s): ";
for(int i=last+1; i<s.first; ++i)
{
std::cerr << i<< " ";
}
std::cerr << "\n";
}
if(s.second.m_parents.size() == 0)
......
......@@ -69,4 +69,17 @@ This is section 7
[[section-8]]
== 8
This section is unreached
\ No newline at end of file
This section is unreached
Turn to <<section-12>>
[[section-16]]
== 16
Far ahead in the story
[[section-10]]
== 10
This section was written very late!
Turn to <<section-12>>
\ No newline at end of file
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