Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: mojo/public/tools/bindings/run_code_generators.py

Issue 1508293004: Simplify Go's Mojom Type Generator (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Add store_true to the argparse Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/tools/bindings/run_code_generators.py
diff --git a/mojo/public/tools/bindings/run_code_generators.py b/mojo/public/tools/bindings/run_code_generators.py
index 46ddfcb10fb321854d4faf5e43da68a2905ee2ee..31331fbca335759be3245f5c271c665cdaca4b8b 100755
--- a/mojo/public/tools/bindings/run_code_generators.py
+++ b/mojo/public/tools/bindings/run_code_generators.py
@@ -39,6 +39,13 @@ def _ParseCLIArgs():
help="comma-separated list of generators")
parser.add_argument("-d", "--depth", dest="depth", default=".",
help="relative path to the root of the source tree.")
+ parser.add_argument("--generate_type_info", dest="generate_type_info",
azani 2015/12/21 22:28:37 Make the argument name "generate-type-info" to mat
alexfandrianto 2015/12/21 23:50:11 Done.
+ action="store_true",
+ help="do not generate mojom type descriptors")
+ parser.add_argument("--no_generate_type_info", dest="generate_type_info",
+ action="store_false",
+ help="do not generate mojom type descriptors")
+ parser.set_defaults(generate_type_info=True)
azani 2015/12/21 22:28:37 Just use the default param to add_argument. Also,
alexfandrianto 2015/12/21 23:50:11 The default is true so that the test(s) will compi
azani 2016/01/04 22:20:44 I understand your point regarding tests, but if we
return parser.parse_known_args()
@@ -162,6 +169,8 @@ def main():
prefix = '--' + generator_module.GENERATOR_PREFIX + '_'
filtered_args = [arg for arg in remaining_args
if arg.startswith(prefix)]
+ if args.generate_type_info:
+ filtered_args.append("--generate_type_info")
generator.GenerateFiles(filtered_args)

Powered by Google App Engine
This is Rietveld 408576698