mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
Fix: Actually call ValidateOptions (#8665)
* fix: actually call ValidateOptions * convert error to warning in validateoptions
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user