From 21661b7f55b65a3a0ca6d01d2073d66deddd6772 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Thu, 14 Nov 2013 10:34:55 -0800 Subject: [PATCH] Bug 928195 - Part 4: mach command for generating WebIDL example files; r=froydnj --HG-- extra : rebase_source : c2c2667cae91eae9e444f9d7cbd2750a5207af5d --- dom/bindings/mach_commands.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dom/bindings/mach_commands.py b/dom/bindings/mach_commands.py index e176d91cd4e..35f9ef70b5f 100644 --- a/dom/bindings/mach_commands.py +++ b/dom/bindings/mach_commands.py @@ -18,6 +18,17 @@ from mozbuild.base import MachCommandBase @CommandProvider class WebIDLProvider(MachCommandBase): + @Command('webidl-example', category='misc', + description='Generate example files for a WebIDL interface.') + @CommandArgument('interface', nargs='+', + help='Interface(s) whose examples to generate.') + def webidl_example(self, interface): + from mozwebidl import BuildSystemWebIDL + + manager = self._spawn(BuildSystemWebIDL).manager + for i in interface: + manager.generate_example_files(i) + @Command('webidl-parser-test', category='testing', description='Run WebIDL tests.') @CommandArgument('--verbose', '-v', action='store_true',