parent
8d361f88d7
commit
fd8db544bd
15
src/main.cpp
15
src/main.cpp
|
@ -125,10 +125,17 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
cout << ", page " << match.page;
|
||||
}
|
||||
cout << ": " << match.context.first
|
||||
<< termcolor::bright_magenta << match.text
|
||||
<< termcolor::reset << match.context.second
|
||||
<< '\n';
|
||||
cout << ": " << match.context.first;
|
||||
if (vm.count("nocolor") == 0)
|
||||
{
|
||||
cout << termcolor::bright_magenta << match.text
|
||||
<< termcolor::reset;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << match.text;
|
||||
}
|
||||
cout << match.context.second << '\n';
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
|
|
|
@ -70,7 +70,9 @@ po::variables_map parse_options(int argc, char *argv[])
|
|||
translate("Do not clean up text before searching.").str().data())
|
||||
("context,C", po::value<std::uint64_t>()
|
||||
->value_name(translate("NUMBER"))->default_value(0),
|
||||
translate("Print NUMBER words of context around matches.").str().data())
|
||||
translate("Print NUMBER words of context around matches.")
|
||||
.str().data())
|
||||
("nocolor", translate("Do not color matches.") .str().data())
|
||||
;
|
||||
|
||||
po::options_description options_hidden("Hidden options");
|
||||
|
|
Loading…
Reference in New Issue
Block a user