Refractor Flatc Options (#6987)

* Moved error/warnings to bottom of std error

* Refactor flatc options

* pass program name to flatc

* extra -- in one option

* merge of upstream
This commit is contained in:
Derek Bailey
2021-12-13 13:56:47 -08:00
committed by GitHub
parent 8dcd2682c7
commit 3cbc120a08
3 changed files with 317 additions and 188 deletions

View File

@@ -31,6 +31,13 @@ namespace flatbuffers {
extern void LogCompilerWarn(const std::string &warn);
extern void LogCompilerError(const std::string &err);
struct FlatCOption {
std::string short_opt;
std::string long_opt;
std::string parameter;
std::string description;
};
class FlatCompiler {
public:
// Output generator for the various programming languages and formats we
@@ -44,13 +51,11 @@ class FlatCompiler {
const std::string &file_name);
GenerateFn generate;
const char *generator_opt_short;
const char *generator_opt_long;
const char *lang_name;
bool schema_only;
GenerateFn generateGRPC;
flatbuffers::IDLOptions::Language lang;
const char *generator_help;
FlatCOption option;
MakeRuleFn make_rule;
BfbsGenerator *bfbs_generator;
};