Show help message when -i or -m is not set (#3144)
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user