From a8bdee6359946558c3effb86b51547c9fb807140 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Tue, 17 Nov 2020 10:50:23 +0300 Subject: [PATCH] Show help message when -i or -m is not set (#3144) --- inference-engine/samples/benchmark_app/main.cpp | 1 + inference-engine/samples/classification_sample_async/main.cpp | 2 ++ inference-engine/samples/ngraph_function_creation_sample/main.cpp | 2 ++ inference-engine/samples/object_detection_sample_ssd/main.cpp | 2 ++ inference-engine/samples/style_transfer_sample/main.cpp | 2 ++ 5 files changed, 9 insertions(+) diff --git a/inference-engine/samples/benchmark_app/main.cpp b/inference-engine/samples/benchmark_app/main.cpp index ebb93eb..223212f 100644 --- a/inference-engine/samples/benchmark_app/main.cpp +++ b/inference-engine/samples/benchmark_app/main.cpp @@ -48,6 +48,7 @@ bool ParseAndCheckCommandLine(int argc, char *argv[]) { } if (FLAGS_m.empty()) { + showUsage(); throw std::logic_error("Model is required but not set. Please set -m option."); } diff --git a/inference-engine/samples/classification_sample_async/main.cpp b/inference-engine/samples/classification_sample_async/main.cpp index a4afc80..1e764ff 100644 --- a/inference-engine/samples/classification_sample_async/main.cpp +++ b/inference-engine/samples/classification_sample_async/main.cpp @@ -44,10 +44,12 @@ bool ParseAndCheckCommandLine(int argc, char *argv[]) { slog::info << "Parsing input parameters" << slog::endl; if (FLAGS_m.empty()) { + showUsage(); throw std::logic_error("Model is required but not set. Please set -m option."); } if (FLAGS_i.empty()) { + showUsage(); throw std::logic_error("Input is required but not set. Please set -i option."); } diff --git a/inference-engine/samples/ngraph_function_creation_sample/main.cpp b/inference-engine/samples/ngraph_function_creation_sample/main.cpp index 057737a..cb067e5 100644 --- a/inference-engine/samples/ngraph_function_creation_sample/main.cpp +++ b/inference-engine/samples/ngraph_function_creation_sample/main.cpp @@ -36,10 +36,12 @@ bool ParseAndCheckCommandLine(int argc, char* argv[]) { } if (FLAGS_m.empty()) { + showUsage(); throw std::logic_error("Path to a .bin file with weights for the trained model is required but not set. Please set -m option."); } if (FLAGS_i.empty()) { + showUsage(); throw std::logic_error("Path to an image is required but not set. Please set -i option."); } diff --git a/inference-engine/samples/object_detection_sample_ssd/main.cpp b/inference-engine/samples/object_detection_sample_ssd/main.cpp index fbb2316..233caa7 100644 --- a/inference-engine/samples/object_detection_sample_ssd/main.cpp +++ b/inference-engine/samples/object_detection_sample_ssd/main.cpp @@ -37,10 +37,12 @@ bool ParseAndCheckCommandLine(int argc, char *argv[]) { slog::info << "Parsing input parameters" << slog::endl; if (FLAGS_m.empty()) { + showUsage(); throw std::logic_error("Model is required but not set. Please set -m option."); } if (FLAGS_i.empty()) { + showUsage(); throw std::logic_error("Input is required but not set. Please set -i option."); } diff --git a/inference-engine/samples/style_transfer_sample/main.cpp b/inference-engine/samples/style_transfer_sample/main.cpp index b85ab42..e410c71 100644 --- a/inference-engine/samples/style_transfer_sample/main.cpp +++ b/inference-engine/samples/style_transfer_sample/main.cpp @@ -34,10 +34,12 @@ bool ParseAndCheckCommandLine(int argc, char *argv[]) { } if (FLAGS_m.empty()) { + showUsage(); throw std::logic_error("Model is required but not set. Please set -m option."); } if (FLAGS_i.empty()) { + showUsage(); throw std::logic_error("Input is required but not set. Please set -i option."); } -- 2.7.4