diff --git a/man/epubgrep.1.adoc b/man/epubgrep.1.adoc index 6d56b01..53405c7 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-25 +:Date: 2021-05-26 :Revision: 0.0.0 :man source: epubgrep :man manual: General Commands Manual @@ -58,6 +58,10 @@ Print _NUMBER_ words of context around matches. *--nocolor*:: Do not color matches. +*--no-filename*:: +Suppress the mentioning of file names on output. Chapters and page numbers will +still be output. + == USAGE [source,shellsession] diff --git a/src/main.cpp b/src/main.cpp index 30341db..91f7f40 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -115,11 +115,17 @@ int main(int argc, char *argv[]) for (const auto &match : search::search(filepath, regex, opts)) { - cout << match.filepath; + if (vm.count("no-filename") == 0) + { + cout << match.filepath; + } if (!match.headline.empty()) { - - cout << ", " << match.headline; + if (vm.count("no-filename") == 0) + { + cout << ", "; + } + cout << match.headline; } if (!match.page.empty()) { diff --git a/src/options.cpp b/src/options.cpp index 849acd0..0bd6c98 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -73,6 +73,9 @@ po::variables_map parse_options(int argc, char *argv[]) translate("Print NUMBER words of context around matches.") .str().data()) ("nocolor", translate("Do not color matches.") .str().data()) + ("no-filename", + translate("Suppress the mentioning of file names on output.") + .str().data()) ; po::options_description options_hidden("Hidden options"); diff --git a/translations/de.po b/translations/de.po index c273b15..1fcbf99 100644 --- a/translations/de.po +++ b/translations/de.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: epubgrep 0.2.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-05-25 12:32+0200\n" -"PO-Revision-Date: 2021-05-25 12:32+0200\n" +"POT-Creation-Date: 2021-05-26 09:03+0200\n" +"PO-Revision-Date: 2021-05-26 09:03+0200\n" "Last-Translator: tastytea \n" "Language-Team: tastytea \n" "Language: de\n" @@ -17,7 +17,7 @@ msgstr "" "X-Poedit-KeywordsList: translate\n" "X-Poedit-SearchPath-0: .\n" -#: src/main.cpp:63 src/main.cpp:143 +#: src/main.cpp:63 src/main.cpp:149 msgid "ERROR: " msgstr "FEHLER: " @@ -25,7 +25,7 @@ msgstr "FEHLER: " msgid "Error while parsing options." msgstr "Fehler während Optionen interpretiert wurden." -#: src/main.cpp:144 +#: src/main.cpp:150 msgid "Error while searching." msgstr "Fehler während der Suche." @@ -85,11 +85,15 @@ msgstr "ANZAHL Wörter an Kontext um die Treffer herum ausgeben." msgid "Do not color matches." msgstr "Färbe die Treffer nicht ein." -#: src/options.cpp:116 +#: src/options.cpp:77 +msgid "Suppress the mentioning of file names on output." +msgstr "Unterdrücke die Erwähnung des Dateinamens in der Ausgabe." + +#: src/options.cpp:119 msgid "Usage: epubgrep [OPTION]… PATTERN [FILE]…\n" msgstr "Aufruf: epubgrep [OPTION]… MUSTER [DATEI]…\n" -#: src/options.cpp:118 +#: src/options.cpp:121 msgid "" "\n" "You can access the full manual with `man epubgrep`.\n" @@ -97,7 +101,7 @@ msgstr "" "\n" "Du kannst mit `man epubgrep` auf das vollständige Handbuch zugreifen.\n" -#: src/options.cpp:125 +#: src/options.cpp:128 msgid "" "Copyright © 2021 tastytea \n" "License AGPL-3.0-only .\n"