Bug 1108294 - Use positional arguments; r=froydnj
authorGregory Szorc <gps@mozilla.com>
Sat, 06 Dec 2014 15:39:53 -0800
changeset 218917 2662199707fd67747f88ea530ac0ce0cb9e19820
parent 218916 3de240f1f86eaeca873e317e10f5945c6e2adeb7
child 218918 c9bbb3e155e907b4727cf70015f9486e9926b1c2
push id52679
push usergszorc@mozilla.com
push dateTue, 09 Dec 2014 22:53:04 +0000
treeherdermozilla-inbound@445641aa96c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1108294
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1108294 - Use positional arguments; r=froydnj There is only 1 caller to AccEventGen.py in the tree. We don't need optional arguments. Convert them to positional. Since the arguments are no longer optional, branches related to their presence have been removed.
accessible/xpcom/AccEventGen.py
accessible/xpcom/Makefile.in
--- a/accessible/xpcom/AccEventGen.py
+++ b/accessible/xpcom/AccEventGen.py
@@ -193,38 +193,34 @@ def write_cpp(eventname, iface, fd):
         writeAttributeGetter(fd, classname, a)
 
 
 def main():
     from argparse import ArgumentParser
     o = ArgumentParser()
     o.add_argument('-I', action='append', dest='incdirs', default=['.'],
                  help="Directory to search for imported files")
-    o.add_argument('-o', "--stub-output",
-                 dest='stub_output', default=None,
-                 help="C++ source output file", metavar="FILE")
-    o.add_argument('--header-output', default=None,
-                 help="Quick stub header output file", metavar="FILE")
-    o.add_argument('--makedepend-output', default=None,
-                 help="gnumake dependencies output file", metavar="FILE")
     o.add_argument('config',
                  help='Config file to load')
+    o.add_argument('header_output', metavar='FILE',
+                 help="Quick stub header output file")
+    o.add_argument('stub_output', metavar='FILE',
+                 help="C++ source output file")
+    o.add_argument('makedepend_output', metavar='FILE',
+                 help="gnumake dependencies output file")
     global options
     options = o.parse_args()
 
     # Instantiate the parser.
     global p
     p = xpidl.IDLParser()
 
     conf = readConfigFile(options.config)
 
-    if options.stub_output:
-        makeutils.targets.append(options.stub_output)
-        with open(options.stub_output, 'w') as fh:
-            print_cpp_file(fh, conf)
-        if options.makedepend_output:
-            makeutils.writeMakeDependOutput(options.makedepend_output)
-    if options.header_output:
-        with open(options.header_output, 'w') as fh:
-            print_header_file(fh, conf)
+    makeutils.targets.append(options.stub_output)
+    with open(options.stub_output, 'w') as fh:
+        print_cpp_file(fh, conf)
+    makeutils.writeMakeDependOutput(options.makedepend_output)
+    with open(options.header_output, 'w') as fh:
+        print_header_file(fh, conf)
 
 if __name__ == '__main__':
     main()
--- a/accessible/xpcom/Makefile.in
+++ b/accessible/xpcom/Makefile.in
@@ -14,19 +14,19 @@ include $(topsrcdir)/config/rules.mk
 xpcAccEvents.cpp: $(srcdir)/AccEvents.conf \
                      $(srcdir)/AccEventGen.py \
                      $(LIBXUL_DIST)/sdk/bin/header.py \
                      $(LIBXUL_DIST)/sdk/bin/xpidl.py
 	$(PYTHON) $(topsrcdir)/config/pythonpath.py \
 	  -I$(LIBXUL_DIST)/sdk/bin \
 	  $(srcdir)/AccEventGen.py \
 	  -I $(DEPTH)/dist/idl \
-	  --header-output xpcAccEvents.h \
-	  --stub-output xpcAccEvents.cpp \
-	  --makedepend-output $(MDDEPDIR)/xpcAccEvents.pp \
-	  $(srcdir)/AccEvents.conf
+	  $(srcdir)/AccEvents.conf \
+	  xpcAccEvents.h \
+	  xpcAccEvents.cpp \
+	  $(MDDEPDIR)/xpcAccEvents.pp
 
 xpcAccEvents.h: xpcAccEvents.cpp
 
 GARBAGE += \
   xpcAccEvents.cpp \
   xpcAccEvents.h \
   $(null)