Rename prefix to metadata in print_matches().

This commit is contained in:
tastytea 2021-05-30 18:09:31 +02:00
parent 03138c1dbf
commit fe23fcf04b
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 6 additions and 6 deletions

View File

@ -54,23 +54,23 @@ void print_matches(const std::vector<search::match> &matches,
}
}
std::vector<std::string> prefix;
std::vector<std::string> metadata;
if (!opts.no_fn_epub)
{
prefix.emplace_back(match.filepath);
metadata.emplace_back(match.filepath);
}
if (!match.headline.empty())
{
prefix.emplace_back(match.headline);
metadata.emplace_back(match.headline);
}
if (!match.page.empty())
{
prefix.emplace_back("page " + match.page);
metadata.emplace_back("page " + match.page);
}
for (const auto &part : prefix)
for (const auto &part : metadata)
{
cout << part;
if (part != *(prefix.rbegin()))
if (part != *(metadata.rbegin()))
{
cout << ", ";
}