Show help message when -i or -m is not set (#3144)

This commit is contained in:
Anton Romanov
2020-11-17 10:50:23 +03:00
committed by GitHub
parent be044a7003
commit a8bdee6359
5 changed files with 9 additions and 0 deletions

View 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.");
}

View 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.");
}

View 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.");
}

View 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.");
}

View 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.");
}