From dde00234d952f9ab19e251559b8e5d3952dc12c3 Mon Sep 17 00:00:00 2001 From: Roger Meier Date: Sun, 10 Jan 2016 16:44:09 +0100 Subject: [PATCH] THRIFT-2790 thrift -gen all => an option to generate all languages and features --- compiler/cpp/src/main.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/compiler/cpp/src/main.cc b/compiler/cpp/src/main.cc index 1b3b633f737..0b51866ada4 100644 --- a/compiler/cpp/src/main.cc +++ b/compiler/cpp/src/main.cc @@ -1129,7 +1129,18 @@ int main(int argc, char** argv) { fprintf(stderr, "Missing generator specification\n"); usage(); } - generator_strings.push_back(arg); + + // -gen all option to easily test compatibility of an idl + if (strcmp(arg, "all") == 0) { + t_generator_registry::gen_map_t gen_map = t_generator_registry::get_generator_map(); + t_generator_registry::gen_map_t::iterator iter; + for (iter = gen_map.begin(); iter != gen_map.end(); ++iter) { + generator_strings.push_back(iter->second->get_short_name().c_str()); + } + } + else { + generator_strings.push_back(arg); + } } else if (strcmp(arg, "-I") == 0) { // An argument of "-I\ asdf" is invalid and has unknown results arg = argv[++i];