diff --git a/src/main.cpp b/src/main.cpp index 8b5d448..a339f7f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -80,6 +80,11 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } + if (opts.debug) + { + log::enable_debug(); + } + if (opts.help || opts.version) { return EXIT_SUCCESS; diff --git a/src/options.cpp b/src/options.cpp index d8cda45..ea1093e 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -88,6 +88,8 @@ options parse_options(int argc, char *argv[]) "following symlinks.") .str().data()) ("ignore-archive-errors", translate("Ignore errors about wrong file formats.") .str().data()) + ("debug", + translate("Enable debug output.") .str().data()) ; po::options_description options_hidden("Hidden options"); @@ -226,6 +228,7 @@ options parse_again(const po::variables_map &vm) opts.recursive = vm.count("recursive") > 0; opts.dereference_recursive = vm.count("dereference-recursive") > 0; opts.ignore_archive_errors = vm.count("ignore-archive-errors") > 0; + opts.debug = vm.count("debug") > 0; if (vm.count("regexp") > 0) { diff --git a/src/options.hpp b/src/options.hpp index ee43d80..68506b5 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -55,6 +55,7 @@ struct options bool dereference_recursive{false}; std::vector input_file; bool ignore_archive_errors{false}; + bool debug{false}; }; //! Parse options and return them.