diff --git a/src/main.cpp b/src/main.cpp index fd37cb0..9a19ed3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -78,12 +78,17 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } + vector input_files; if (vm.count("input-file") == 0) { cout << "NO INPUT FILE\n"; // TODO: Read data from stdin. return EXIT_FAILURE; } + for (const auto &filepath : vm["input-file"].as>()) + { + input_files.emplace_back(filepath); + } int return_code{EXIT_SUCCESS}; @@ -118,7 +123,7 @@ int main(int argc, char *argv[]) vector> futurepool; auto search_file{ - [&vm, &matches_all, &opts](std::string_view filepath) + [&vm, &matches_all, &opts](fs::path filepath) { for (const auto ®ex : vm["regexp"].as>()) { @@ -172,7 +177,7 @@ int main(int argc, char *argv[]) return static_cast(std::ceil(n / 2 + n / 4)); }()}; - for (const auto &filepath : vm["input-file"].as>()) + for (const auto &filepath : input_files) { if (futurepool.size() >= max_threads) {