Bug 893830 - Followup based on feedback: output both forms by default. r=gps DONTBUILD
authorGraeme McCutcheon <graememcc_firefox@graeme-online.co.uk>
Wed, 02 Oct 2013 09:06:39 +0100
changeset 163436 91690a35f26d72bb3aa34faa9fabf3577435fa20
parent 163435 32c6282f3a29dba12f60ff30945d0d22bd7ea948
child 163437 ad70d9583d42cfd0ccf8d980c9303e34ccdc5a77
push idunknown
push userunknown
push dateunknown
reviewersgps
bugs893830
milestone27.0a1
Bug 893830 - Followup based on feedback: output both forms by default. r=gps DONTBUILD
tools/mach_commands.py
--- a/tools/mach_commands.py
+++ b/tools/mach_commands.py
@@ -134,24 +134,26 @@ class IDLUpdater(object):
         for p, f in self.registry:
             f.copy(p)
 
 
 @CommandProvider
 class UUIDProvider(object):
     @Command('uuid', category='misc',
         description='Generate a uuid.')
-    @CommandArgument('--format', '-f', choices=['idl', 'cpp'], default='idl',
+    @CommandArgument('--format', '-f', choices=['idl', 'cpp', 'c++'],
                      help='Output format for the generated uuid.')
-    def uuid(self, format):
+    def uuid(self, format=None):
         import uuid
         u = uuid.uuid4()
-        if format == 'idl':
+        if format in [None, 'idl']:
             print(u)
-        else:
+            if format is None:
+                print('')
+        if format in [None, 'cpp', 'c++']:
             u = u.hex
             print('{ 0x%s, 0x%s, 0x%s, \\' % (u[0:8], u[8:12], u[12:16]))
             pairs = tuple(map(lambda n: u[n:n+2], range(16, 32, 2)))
             print(('  { ' + '0x%s, ' * 7 + '0x%s } }') % pairs)
 
     @Command('update-uuids', category='misc',
         description='Update IDL files with new UUIDs.')
     @CommandArgument('--path', default='.',