Don't output empty fields.
This commit is contained in:
parent
972ce1d0fe
commit
8b21f4a8b9
15
src/main.cpp
15
src/main.cpp
@ -111,9 +111,18 @@ int main(int argc, char *argv[])
|
||||
|
||||
for (const auto &match : search::search(filepath, regex, opts))
|
||||
{
|
||||
cout << match.filepath << ", " << match.headline << ", "
|
||||
<< match.page << ": " << match.context.first
|
||||
<< match.text << match.context.second << '\n';
|
||||
cout << match.filepath;
|
||||
if (!match.headline.empty())
|
||||
{
|
||||
|
||||
cout << ", " << match.headline;
|
||||
}
|
||||
if (!match.page.empty())
|
||||
{
|
||||
cout << ", " << match.page;
|
||||
}
|
||||
cout << ": " << match.context.first << match.text
|
||||
<< match.context.second << '\n';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user