Bug 1439727 - Add a docstring for `mach clobber`; r?build draft
authorGregory Szorc <gps@mozilla.com>
Wed, 07 Mar 2018 08:49:13 -0800
changeset 764317 78d0267c15f7960520c899e80cd824b21f258bdc
parent 764316 11ce370649f09ddcb592350f5290e90301309b56
child 764318 0b002fe36a60ac15c7002686c36b50c0cb9f3ed4
child 764647 6de5c21f8d86391b4437176f45b4e1c9bd5ac099
push id101735
push userbmo:gps@mozilla.com
push dateWed, 07 Mar 2018 17:00:03 +0000
Bug 1439727 - Add a docstring for `mach clobber`; r?build This makes `mach help clobber` more useful. MozReview-Commit-ID: GsIUqhUzVGP
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -336,16 +336,32 @@ class Clobber(MachCommandBase):
     @Command('clobber', category='build',
         description='Clobber the tree (delete the object directory).')
     @CommandArgument('what', default=['objdir'], nargs='*',
         help='Target to clobber, must be one of {{{}}} (default objdir).'.format(
              ', '.join(CLOBBER_CHOICES)))
     @CommandArgument('--full', action='store_true',
         help='Perform a full clobber')
     def clobber(self, what, full=False):
+        """Clean up the source and object directories.
+        Performing builds and running various commands generate various files.
+        Sometimes it is necessary to clean up these files in order to make
+        things work again. This command can be used to perform that cleanup.
+        By default, this command removes most files in the current object
+        directory (where build output is stored). Some files (like Visual
+        Studio project files) are not removed by default. If you would like
+        to remove the object directory in its entirety, run with `--full`.
+        The `python` target will clean up various generated Python files from
+        the source directory. Run this to remove .pyc files, compiled C
+        extensions, etc.
+        """
         invalid = set(what) - set(self.CLOBBER_CHOICES)
         if invalid:
             print('Unknown clobber target(s): {}'.format(', '.join(invalid)))
             return 1
         ret = 0
         if 'objdir' in what:
             from mozbuild.controller.clobber import Clobberer