Bug 848507 - Support searching DXR in mach; r=gps
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 06 Mar 2013 15:23:21 -0500
changeset 134328 f64b3dbe0b53ee23fab755234c83cb0669254553
parent 134327 794ad1f82fd7f2dc6350d942c25bcf223f41330c
child 134329 7a20fb6025b3f8f05846fdf7d33d5d07a40f60cc
push idunknown
push userunknown
push dateunknown
reviewersgps
bugs848507
milestone22.0a1
Bug 848507 - Support searching DXR in mach; r=gps DONTBUILD because this is NPOTB.
tools/mach_commands.py
--- a/tools/mach_commands.py
+++ b/tools/mach_commands.py
@@ -16,16 +16,24 @@ class SearchProvider(object):
     @Command('mxr', help='Search for something in MXR.')
     @CommandArgument('term', nargs='+', help='Term(s) to search for.')
     def mxr(self, term):
         import webbrowser
         term = ' '.join(term)
         uri = 'https://mxr.mozilla.org/mozilla-central/search?string=%s' % term
         webbrowser.open_new_tab(uri)
 
+    @Command('dxr', help='Search for something in DXR.')
+    @CommandArgument('term', nargs='+', help='Term(s) to search for.')
+    def dxr(self, term):
+        import webbrowser
+        term = ' '.join(term)
+        uri = 'http://dxr.mozilla.org/search?tree=mozilla-central&q=%s' % term
+        webbrowser.open_new_tab(uri)
+
     @Command('mdn', help='Search for something on MDN.')
     @CommandArgument('term', nargs='+', help='Term(s) to search for.')
     def mdn(self, term):
         import webbrowser
         term = ' '.join(term)
         uri = 'https://developer.mozilla.org/search?q=%s' % term
         webbrowser.open_new_tab(uri)