Skip to content

Fix #248 #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 23 additions & 15 deletions src/ClientGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ int main(int argc, char** argv)
po::variables_map variables;
bool showUsage = false;
bool showVersion = false;
bool buildCustom = false;
bool verbose = false;
bool noIntrospection = false;
std::string schemaFileName;
Expand Down Expand Up @@ -1264,21 +1265,28 @@ int main(int argc, char** argv)
variables);
po::notify(variables);

if (schemaFileName.empty())
{
throw po::required_option("schema");
}
else if (requestFileName.empty())
{
throw po::required_option("request");
}
else if (filenamePrefix.empty())
{
throw po::required_option("prefix");
}
else if (schemaNamespace.empty())
// If you specify any of these parameters, you must specify all four.
buildCustom = !schemaFileName.empty() || !requestFileName.empty() || !filenamePrefix.empty()
|| !schemaNamespace.empty();

if (buildCustom)
{
throw po::required_option("namespace");
if (schemaFileName.empty())
{
throw po::required_option("schema");
}
else if (requestFileName.empty())
{
throw po::required_option("request");
}
else if (filenamePrefix.empty())
{
throw po::required_option("prefix");
}
else if (schemaNamespace.empty())
{
throw po::required_option("namespace");
}
}
}
catch (const po::error& oe)
Expand All @@ -1293,7 +1301,7 @@ int main(int argc, char** argv)
outputVersion(std::cout);
return 0;
}
else if (showUsage)
else if (showUsage || !buildCustom)
{
outputUsage(std::cout, options);
return 0;
Expand Down