Do not show prefix in output if there is no metadata.
Previously epubgrep would output “: match” instead of “match”. Closes: #15
This commit is contained in:
parent
b2a6f9217b
commit
18c3d8f58d
|
@ -78,6 +78,8 @@ void print_matches(const std::vector<search::match> &matches,
|
|||
{
|
||||
metadata.emplace_back("page " + match.page);
|
||||
}
|
||||
if (!metadata.empty())
|
||||
{
|
||||
if (!opts.nocolor)
|
||||
{
|
||||
cout << termcolor::italic;
|
||||
|
@ -95,6 +97,7 @@ void print_matches(const std::vector<search::match> &matches,
|
|||
{
|
||||
cout << termcolor::reset;
|
||||
}
|
||||
}
|
||||
cout << match.context.first;
|
||||
if (!opts.nocolor)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user