[patch] fix "bzr -h"

Martin Pool mbp at sourcefrog.net
Wed Mar 22 17:48:32 GMT 2006


trivial:

https://launchpad.net/products/bzr/+bug/35940

-- 
Martin
-------------- next part --------------
=== modified file 'a/NEWS'
--- a/NEWS	
+++ b/NEWS	
@@ -73,6 +73,8 @@
       new revision number.  (Robert Collins, Martin Pool)
 
     * Unify 'mv', 'move', 'rename'.  (#5379, Matthew Fuller)
+
+    * 'bzr -h' shows help.  (#35940, Martin Pool, Ian Bicking)
 
   INTERNALS:
   

=== modified file 'a/bzrlib/commands.py'
--- a/bzrlib/commands.py	
+++ b/bzrlib/commands.py	
@@ -568,7 +568,7 @@
         i += 1
 
     argv = argv_copy
-    if (not argv) or (argv[0] == '--help'):
+    if (not argv) or (argv[0] == '--help') or (argv[0] == '-h'):
         from bzrlib.help import help
         if len(argv) > 1:
             help(argv[1])

=== modified file 'a/bzrlib/tests/blackbox/test_help.py'
--- a/bzrlib/tests/blackbox/test_help.py	
+++ b/bzrlib/tests/blackbox/test_help.py	
@@ -1,5 +1,4 @@
-# Copyright (C) 2005 by Canonical Ltd
-# -*- coding: utf-8 -*-
+# Copyright (C) 2005, 2006 by Canonical Ltd
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -29,6 +28,9 @@
         dash_help = self.runbzr('--help')[0]
         just_help = self.runbzr('help')[0]
         quest_mk  = self.runbzr('?')[0]
+        # see https://launchpad.net/products/bzr/+bug/35940, -h doesn't work
+        dash_h = self.runbzr('-h')[0]
+        self.assertEquals(dash_help, dash_h)
         self.assertEquals(dash_help, just_help)
         self.assertEquals(dash_help, quest_mk)
 

=== modified file 'a/bzrlib/tests/test_options.py'
--- a/bzrlib/tests/test_options.py	
+++ b/bzrlib/tests/test_options.py	
@@ -1,9 +1,11 @@
-# (C) 2005 Canonical
+# Copyright (C) 2005, 2006 Canonical Ltd
 
 from bzrlib.tests import TestCase
 from bzrlib.commands import Command, parse_args
 from bzrlib.builtins import cmd_commit, cmd_log, cmd_status
 
+# TODO: might be nice to just parse them into a structured form and test
+# against that, rather than running the whole command.
 
 class OptionTests(TestCase):
     """Command-line option tests"""

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060322/d638cee1/attachment.pgp 


More information about the bazaar mailing list