Rev 2609: Insist that all options have a help string and fix those that don't. in http://sourcefrog.net/bzr/check-options

Martin Pool mbp at sourcefrog.net
Wed Jul 11 06:19:05 BST 2007


At http://sourcefrog.net/bzr/check-options

------------------------------------------------------------
revno: 2609
revision-id: mbp at sourcefrog.net-20070711051842-rt9uj743zir4ixhn
parent: mbp at sourcefrog.net-20070711050413-hrgdcuhrujn974gc
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: check-options
timestamp: Wed 2007-07-11 15:18:42 +1000
message:
  Insist that all options have a help string and fix those that don't.
  (Thanks John)
modified:
  bzrlib/builtins.py             builtins.py-20050830033751-fc01482b9ca23183
  bzrlib/option.py               option.py-20051014052914-661fb36e76e7362f
  bzrlib/tests/test_options.py   testoptions.py-20051014093702-96457cfc86319a8f
=== modified file 'bzrlib/builtins.py'
--- a/bzrlib/builtins.py	2007-07-11 05:04:13 +0000
+++ b/bzrlib/builtins.py	2007-07-11 05:18:42 +0000
@@ -340,7 +340,7 @@
     takes_args = ['file*']
     takes_options = [
         Option('no-recurse',
-               ),
+               help="Don't recursively add the contents of directories."),
         Option('dry-run',
                help="Show what would be done, but don't actually do anything."),
         'verbose',
@@ -443,7 +443,12 @@
 
     hidden = True
     _see_also = ['ls']
-    takes_options = ['revision', 'show-ids', 'kind']
+    takes_options = [
+        'revision',
+        'show-ids',
+        Option('kind',
+               help='List entries of a particular kind: file, directory, symlink.'),
+        ]
     takes_args = ['file*']
 
     @display_command
@@ -1394,12 +1399,13 @@
     _see_also = ['status']
     takes_args = ['file*']
     takes_options = [
-        'revision',
-        Option('diff-options', type=str),
+        Option('diff-options', type=str,
+               help='Pass these options to the external diff program.'),
         Option('prefix', type=str,
                short_name='p',
                help='Set prefixes to added to old and new filenames, as '
                     'two values separated by a colon. (eg "old/:new/").'),
+        'revision',
         ]
     aliases = ['di', 'dif']
     encoding_type = 'exact'
@@ -1743,7 +1749,8 @@
             Option('null',
                    help='Write an ascii NUL (\\0) separator '
                    'between files rather than a newline.'),
-            'kind',
+            Option('kind',
+                   help='List entries of a particular kind: file, directory, symlink.'),
             'show-ids',
             ]
     @display_command

=== modified file 'bzrlib/option.py'
--- a/bzrlib/option.py	2007-07-11 05:04:13 +0000
+++ b/bzrlib/option.py	2007-07-11 05:18:42 +0000
@@ -387,7 +387,6 @@
 _global_option('remember', help='Remember the specified location as a'
                ' default.')
 _global_option('reprocess', help='Reprocess to reduce spurious conflicts.')
-_global_option('kind', type=str)
 
 _help_option = Option('help',
                       help='Show help message.',

=== modified file 'bzrlib/tests/test_options.py'
--- a/bzrlib/tests/test_options.py	2007-07-11 04:18:52 +0000
+++ b/bzrlib/tests/test_options.py	2007-07-11 05:18:42 +0000
@@ -299,9 +299,8 @@
         option_re = re.compile(r'^[A-Z][^\n]+\.$')
         for scope, option in self.get_all_options():
             if not option.help:
-                # msgs.append('%-16s %-16s %s' %
-                #        ((scope or 'GLOBAL'), option.name, 'NO HELP'))
-                pass
+                msgs.append('%-16s %-16s %s' %
+                       ((scope or 'GLOBAL'), option.name, 'NO HELP'))
             elif not option_re.match(option.help):
                 msgs.append('%-16s %-16s %s' %
                         ((scope or 'GLOBAL'), option.name, option.help))




More information about the bazaar-commits mailing list