From a65b855d4476247b9f71e4a301600b09a848f57b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=EC=83=81=EA=B7=9C/On-Device=20Lab=28SR=29/Princip?= =?utf8?q?al=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Sun, 25 Aug 2019 22:09:26 -0400 Subject: [PATCH] [nnpkg/tflite_run] make help option work (#6879) Currently, tflite/nnpackage_run does not recognize help option. It complains like: $ LD_LIBRARY_PATH=Product/out/lib Product/out/bin/nnpackage_run --help terminate called after throwing an instance of 'boost::exception_detail::clone_impl >' what(): the option '--nnpackage' is required but missing Aborted (core dumped) This patch fixes it by notifying errors after parsing help option. Signed-off-by: Sanggyu Lee --- tests/tools/nnpackage_run/src/args.cc | 3 ++- tests/tools/tflite_run/src/args.cc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/tools/nnpackage_run/src/args.cc b/tests/tools/nnpackage_run/src/args.cc index ef787c8..a7593fa 100644 --- a/tests/tools/nnpackage_run/src/args.cc +++ b/tests/tools/nnpackage_run/src/args.cc @@ -50,7 +50,6 @@ void Args::Parse(const int argc, char **argv) po::variables_map vm; po::store(po::command_line_parser(argc, argv).options(_options).positional(_positional).run(), vm); - po::notify(vm); { auto conflicting_options = [&](const std::string &o1, const std::string &o2) { @@ -72,6 +71,8 @@ void Args::Parse(const int argc, char **argv) exit(0); } + po::notify(vm); + if (vm.count("dump")) { _dump_filename = vm["dump"].as(); diff --git a/tests/tools/tflite_run/src/args.cc b/tests/tools/tflite_run/src/args.cc index ef65784..6c85d88 100644 --- a/tests/tools/tflite_run/src/args.cc +++ b/tests/tools/tflite_run/src/args.cc @@ -54,7 +54,6 @@ void Args::Parse(const int argc, char **argv) po::variables_map vm; po::store(po::command_line_parser(argc, argv).options(_options).positional(_positional).run(), vm); - po::notify(vm); { auto conflicting_options = [&](const std::string &o1, const std::string &o2) { @@ -78,6 +77,8 @@ void Args::Parse(const int argc, char **argv) exit(0); } + po::notify(vm); + if (vm.count("dump")) { _dump_filename = vm["dump"].as(); -- 2.7.4