From 78ada5622606dc0e7d268f775aaee52093db2e4a Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 31 May 2021 15:31:41 +0200 Subject: [PATCH] Make input files required. It will be difficult to parse EPUB files from stdin and the usefulness is questionable. --- src/main.cpp | 6 ------ src/options.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 4a99cd7..6d1d899 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,12 +84,6 @@ int main(int argc, char *argv[]) int return_code{EXIT_SUCCESS}; vector input_files; - if (opts.input_file.empty()) - { - cout << "NO INPUT FILE\n"; - // TODO: Read data from stdin. - return EXIT_FAILURE; - } for (const auto &filepath : opts.input_file) { if (!opts.recursive && !opts.dereference_recursive) diff --git a/src/options.cpp b/src/options.cpp index 4527c8b..a8d2d58 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -91,7 +91,7 @@ options parse_options(int argc, char *argv[]) po::options_description options_hidden("Hidden options"); options_hidden.add_options() - ("input-file", po::value>() + ("input-file", po::value>()->required() ->value_name("FILE"), "Input file to search.") ; // clang-format on