Add --debug switch and enable debugging if it is on.
This commit is contained in:
parent
b12f88003b
commit
28c0a5a797
|
@ -80,6 +80,11 @@ int main(int argc, char *argv[])
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (opts.debug)
|
||||||
|
{
|
||||||
|
log::enable_debug();
|
||||||
|
}
|
||||||
|
|
||||||
if (opts.help || opts.version)
|
if (opts.help || opts.version)
|
||||||
{
|
{
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
|
@ -88,6 +88,8 @@ options parse_options(int argc, char *argv[])
|
||||||
"following symlinks.") .str().data())
|
"following symlinks.") .str().data())
|
||||||
("ignore-archive-errors",
|
("ignore-archive-errors",
|
||||||
translate("Ignore errors about wrong file formats.") .str().data())
|
translate("Ignore errors about wrong file formats.") .str().data())
|
||||||
|
("debug",
|
||||||
|
translate("Enable debug output.") .str().data())
|
||||||
;
|
;
|
||||||
|
|
||||||
po::options_description options_hidden("Hidden options");
|
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.recursive = vm.count("recursive") > 0;
|
||||||
opts.dereference_recursive = vm.count("dereference-recursive") > 0;
|
opts.dereference_recursive = vm.count("dereference-recursive") > 0;
|
||||||
opts.ignore_archive_errors = vm.count("ignore-archive-errors") > 0;
|
opts.ignore_archive_errors = vm.count("ignore-archive-errors") > 0;
|
||||||
|
opts.debug = vm.count("debug") > 0;
|
||||||
|
|
||||||
if (vm.count("regexp") > 0)
|
if (vm.count("regexp") > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,6 +55,7 @@ struct options
|
||||||
bool dereference_recursive{false};
|
bool dereference_recursive{false};
|
||||||
std::vector<std::string> input_file;
|
std::vector<std::string> input_file;
|
||||||
bool ignore_archive_errors{false};
|
bool ignore_archive_errors{false};
|
||||||
|
bool debug{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Parse options and return them.
|
//! Parse options and return them.
|
||||||
|
|
Loading…
Reference in New Issue