Fix: Actually call ValidateOptions (#8665)

* fix: actually call ValidateOptions

* convert error to warning in validateoptions
This commit is contained in:
Justin Davis
2025-08-12 18:30:35 -04:00
committed by GitHub
parent 957e09d684
commit 5218e29aa4

View File

@@ -758,6 +758,8 @@ FlatCOptions FlatCompiler::ParseFromCommandLineArguments(int argc,
}
}
ValidateOptions(options);
return options;
}
@@ -766,9 +768,8 @@ void FlatCompiler::ValidateOptions(const FlatCOptions &options) {
if (!options.filenames.size()) Error("missing input files", false, true);
if (opts.proto_mode) {
if (options.any_generator)
Error("cannot generate code directly from .proto files", true);
if (opts.proto_mode && options.any_generator) {
Warn("cannot generate code directly from .proto files", true);
} else if (!options.any_generator && options.conform_to_schema.empty() &&
options.annotate_schema.empty()) {
Error("no options: specify at least one generator.", true);