From f388dd0511c8ebe75b3b10f87189cbbf3a9a1575 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 24 May 2021 07:50:50 +0200 Subject: [PATCH] Add --raw and --context switches. --- man/epubgrep.1.adoc | 8 +++++++- src/options.cpp | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/man/epubgrep.1.adoc b/man/epubgrep.1.adoc index e85a451..4e68adc 100644 --- a/man/epubgrep.1.adoc +++ b/man/epubgrep.1.adoc @@ -2,7 +2,7 @@ :doctype: manpage :Author: tastytea :Email: tastytea@tastytea.de -:Date: 2021-05-23 +:Date: 2021-05-24 :Revision: 0.0.0 :man source: epubgrep :man manual: General Commands Manual @@ -49,6 +49,12 @@ Ignore case distinctions in pattern and data. *-e* _PATTERN_, *--regexp* _PATTERN_:: Use additional _PATTERN_ for matching. Can be used more than once. +*-a*, *--raw*:: +Do not strip HTML before searching. + +*-C* _NUM_, **context* _NUM_:: +Print _NUM_ words of context around matches. + == USAGE === Configuration diff --git a/src/options.cpp b/src/options.cpp index 97a1bb7..c10e070 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,11 @@ po::variables_map parse_options(int argc, char *argv[]) ("regexp,e", po::value>() ->value_name(translate("PATTERN"))->composing()->required(), translate("Use additional PATTERN for matching.").str().data()) + ("raw,a", + translate("Do not strip HTML before searching.").str().data()) + ("context,C", po::value>() + ->value_name(translate("NUM")), + translate("Print NUM words of context around matches.").str().data()) ; po::options_description options_hidden("Hidden options");