Skip to content

Commit 5218e29

Browse files
authored
Fix: Actually call ValidateOptions (#8665)
* fix: actually call ValidateOptions * convert error to warning in validateoptions
1 parent 957e09d commit 5218e29

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/flatc.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,8 @@ FlatCOptions FlatCompiler::ParseFromCommandLineArguments(int argc,
758758
}
759759
}
760760

761+
ValidateOptions(options);
762+
761763
return options;
762764
}
763765

@@ -766,9 +768,8 @@ void FlatCompiler::ValidateOptions(const FlatCOptions &options) {
766768

767769
if (!options.filenames.size()) Error("missing input files", false, true);
768770

769-
if (opts.proto_mode) {
770-
if (options.any_generator)
771-
Error("cannot generate code directly from .proto files", true);
771+
if (opts.proto_mode && options.any_generator) {
772+
Warn("cannot generate code directly from .proto files", true);
772773
} else if (!options.any_generator && options.conform_to_schema.empty() &&
773774
options.annotate_schema.empty()) {
774775
Error("no options: specify at least one generator.", true);

0 commit comments

Comments
 (0)