Commit Graph

61 Commits

Author SHA1 Message Date
tastytea 37c2fe1bb1
Add HTML output.
continuous-integration/drone/push Build is passing Details
Prints a simple HTML document with tables wrapped in articles to stdout.

Closes: #9
2021-06-08 17:11:32 +02:00
tastytea 6a4511099f
Do not add empty matches to matches_all. 2021-06-01 20:15:05 +02:00
tastytea 21989aabfe
Fix JSON output.
Bug: #3
2021-06-01 20:14:36 +02:00
tastytea f1cb16f6d0
Add JSON output.
Closes: #3
2021-06-01 19:17:44 +02:00
tastytea b0b6c00a90
Log application exit.
continuous-integration/drone/push Build is passing Details
2021-06-01 18:22:15 +02:00
tastytea 6278779029
Don't mask previous failures. 2021-06-01 17:06:25 +02:00
tastytea 07915bdf87
Add lots of debug output. 2021-06-01 15:32:10 +02:00
tastytea 28c0a5a797
Add --debug switch and enable debugging if it is on. 2021-06-01 13:41:54 +02:00
tastytea c35434e745
Simplify LOG macro.
continuous-integration/drone/push Build is passing Details
We only have one logger, no need to specify it every time.
2021-05-31 22:43:30 +02:00
tastytea 4c1bae86ba
Add fatal errors.
Errors are fatal if the program has to stop immediately.
2021-05-31 22:29:35 +02:00
tastytea 1fee4f5afd
Fix file error reporting.
Not sure why exceptions don't have that info… 🤷
2021-05-31 22:22:04 +02:00
tastytea b966be3021
Log suppressed errors to log file. 2021-05-31 19:27:36 +02:00
tastytea 11572d5b29
Use logger for warnings end errors. 2021-05-31 19:12:07 +02:00
tastytea 78ada56226
Make input files required.
It will be difficult to parse EPUB files from stdin and the usefulness is
questionable.
2021-05-31 15:31:41 +02:00
tastytea 03138c1dbf
Remove unnecessary include. 2021-05-30 18:07:13 +02:00
tastytea 03b367ee98
Don't print same file path twice in error message.
zip::exception always has  the filename in the message.
2021-05-29 17:37:41 +02:00
tastytea c94d9de0db
Reformat error messages.
One line per error message.
2021-05-29 12:53:14 +02:00
tastytea 4df7b36dfc
Print matches while still searching.
continuous-integration/drone/push Build is passing Details
Previously we printed the matches at the end.
2021-05-28 17:18:34 +02:00
tastytea 59759b5934
Put output stuff into own function in different file.
It got a little crowded in main(). 😊
2021-05-28 17:07:11 +02:00
tastytea 65b46ca846
Do not allow more threads than max_threads. 2021-05-28 11:48:38 +02:00
tastytea c3131e01f0
Add setting to suppress this-is-not-an-EPUB errors. 2021-05-27 21:48:35 +02:00
tastytea 84f600196c
Add error code to zip::exception. 2021-05-27 21:39:01 +02:00
tastytea b96315f8bb
Don't add extra newlines before errors. 2021-05-27 21:03:42 +02:00
tastytea 8d5565a72c
Don't write to matches_all simultaneously from different threads.
What did I do yesterday?!? 😬

Closes: #6
2021-05-27 20:42:20 +02:00
tastytea fbb87cac81
Remove a few unnecessary .data(), remove unnecessary include. 2021-05-27 19:08:53 +02:00
tastytea c50659a339
Chunk error string to make it better translatable. 2021-05-27 17:24:19 +02:00
tastytea e64591f204
Rework option parsing, change --no-filename.
continuous-integration/drone/push Build is failing Details
Options are now better accessible, --no-filename accepts the values filesystem,
in-epub or all.
2021-05-27 17:20:00 +02:00
tastytea c376ce8466
Print the EPUB file name if more than 1 input file.
Change --no-filename to mean: Don't print the EPUB file name.
2021-05-27 14:46:23 +02:00
tastytea 0c45e7ac98
Add --recursive and --dereference-recursive.
Closes: #5
2021-05-27 14:45:52 +02:00
tastytea b764f5423c
Put input files into a std::vector<filesystem::path>.
We need that for supporting recursive directory search later.

#
# Previous commits:
#   29ae22c Make regex const.
#   8ed72af Update german translation.
#   a3b0964 Remove old comment.
#   d107ce5 Modify config file example.
2021-05-27 13:46:47 +02:00
tastytea a3b0964873
Remove old comment. 2021-05-26 20:20:21 +02:00
tastytea 7dcf6d599c
Remove debug statements. 2021-05-26 18:25:53 +02:00
tastytea fc0aa02bc9
Use threads if more than one input file is searched.
Use 75% of the available threads (rounded up).

Closes: #4
2021-05-26 17:50:52 +02:00
tastytea 694cb3bc44
Add --no-filename switch.
continuous-integration/drone/push Build is passing Details
Suppresses the mentioning of file names on output.
2021-05-26 09:04:16 +02:00
tastytea fd8db544bd
Add --nocolor switch.
Closes: #2
2021-05-25 11:52:13 +02:00
tastytea b72d3f3420
Color matches bright magenta. 2021-05-25 11:00:05 +02:00
tastytea ce015954ea
Only initialize search::options once. 2021-05-25 10:02:34 +02:00
tastytea 1f25daed26
Add basic error handling to search. 2021-05-24 19:10:00 +02:00
tastytea c790c4952c
Extract page numbers. 2021-05-24 18:56:43 +02:00
tastytea 8b21f4a8b9
Don't output empty fields. 2021-05-24 16:37:43 +02:00
tastytea 84e2b387e5
Clean up text before searching. 2021-05-24 16:01:41 +02:00
tastytea 1979956f03
Add basic search functionality and context output. 2021-05-24 15:35:49 +02:00
tastytea 4e01032c6f
Put regex type and --grep in search::options. 2021-05-24 13:13:15 +02:00
tastytea 44ffeb07ec
Add calls to search::search() to main().
All that's missing now is the actual search functionality. 😊
2021-05-24 08:15:04 +02:00
tastytea 3ad4e49e3d
Don't dump zip files to stdout. 2021-05-24 05:46:12 +02:00
tastytea 4b2fbecf93
Print all options at start.
continuous-integration/drone/push Build is passing Details
2021-05-23 16:52:32 +02:00
tastytea 03e07dfc3e
Rework option parsing a bit.
- Add --basic-regexp
- Add --grep
- Remove --input-file
- Make it possible to have multiple --regexp
2021-05-23 16:23:07 +02:00
tastytea e773d4b78a
Implement zip::read_file() – Read file in archive; add test.
Also added zip::open_file() and zip::close_file() to deduplicate code.
2021-05-23 08:56:58 +02:00
tastytea 6334b7051f
Newline before printing error messages. 2021-05-23 08:55:15 +02:00
tastytea 28c6c80def
Set C locale, treat EPUB file names as UTF-8.
EPUB file names MUST be UTF-8. ASCII is a subset of UTF-8.
2021-05-23 06:32:56 +02:00