fail-fast: report missing --relation and --attribute early and avoid crashing without any useful error message
--- a/src/CLIParser.h Thu Sep 24 20:37:52 2020 +0200
+++ b/src/CLIParser.h Thu Sep 24 20:42:34 2020 +0200
@@ -107,6 +107,9 @@
}
addRelation(c, currentRelation); // last relation
+ if (c.relationConfigurations.size() == 0) throw relpipe::cli::RelpipeCLIException(L"There must be at least one relation. Use the " + OPTION_RELATION + L" option.", relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
+ for (auto& rc : c.relationConfigurations) if (rc.attributes.size() == 0) throw relpipe::cli::RelpipeCLIException(L"There must be at least one attribute. Use the " + OPTION_ATTRIBUTE + L" option.", relpipe::cli::CLI::EXIT_CODE_BAD_CLI_ARGUMENTS);
+
return c;
}