Skip to content

Commit

Permalink
Prevent segfault when no args specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Nov 23, 2017
1 parent b27e0ba commit 7b6fe57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generator/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ int main(int argc, char *argv[])
OperationArgument generateArg("generate", 'g', "runs the code generator");
generateArg.setImplicit(true);
ConfigValueArgument inputFileArg("input-file", 'i', "specifies the input file", { "path" });
inputFileArg.setRequired(true);
ConfigValueArgument outputFileArg("output-file", 'o', "specifies the output file", { "path" });
Argument generatorsArg("generators", 'g', "specifies the generators (by default all generators are enabled)");
generatorsArg.setValueNames({ "json" });
Expand All @@ -49,7 +50,7 @@ int main(int argc, char *argv[])

// parse arguments
parser.parseArgsOrExit(argc, argv);
if (helpArg.isPresent()) {
if (helpArg.isPresent() || !generateArg.isPresent()) {
return 0;
}

Expand Down

0 comments on commit 7b6fe57

Please sign in to comment.