Show help message when -i or -m is not set (#3144)
authorAnton Romanov <anton.romanov@intel.com>
Tue, 17 Nov 2020 07:50:23 +0000 (10:50 +0300)
committerGitHub <noreply@github.com>
Tue, 17 Nov 2020 07:50:23 +0000 (10:50 +0300)
inference-engine/samples/benchmark_app/main.cpp
inference-engine/samples/classification_sample_async/main.cpp
inference-engine/samples/ngraph_function_creation_sample/main.cpp
inference-engine/samples/object_detection_sample_ssd/main.cpp
inference-engine/samples/style_transfer_sample/main.cpp

index ebb93eb..223212f 100644 (file)
@@ -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.");
     }
 
index a4afc80..1e764ff 100644 (file)
@@ -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.");
     }
 
index 057737a..cb067e5 100644 (file)
@@ -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.");
     }
 
index fbb2316..233caa7 100644 (file)
@@ -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.");
     }
 
index b85ab42..e410c71 100644 (file)
@@ -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.");
     }