bzr help CMD not printing a terminating newline

Hans Ulrich Niedermann arch at
Mon Jun 6 17:19:24 BST 2005

John A Meinel <john at> writes:

> duchier at wrote:

>> currently "bzr help CMD" does not print a terminating newline
>> because getdoc strips leading and trailing blank lines and
>> outfile.write(doc) does not put back the terminating new line that
>> was removed.

> Actually, what's interesting is that it seems to work correctly if the
> command in question takes any options.
> See:
> bzr help branch
> vs
> bzr help whoami
> Still needs to be fixed, just pointing out where the fix has to be careful.

I had to fix that for the complete manpage generator (available from as usual).

AFAICT, it was just a question of:

*** modified file 'bzrlib/'
--- bzrlib/
+++ bzrlib/
@@ -112,6 +112,8 @@ def help_on_command(cmdname, outfile = N
         outfile.write('aliases: ' + ', '.join(cmdclass.aliases) + '\n')
+    if doc[-1] != '\n':
+        outfile.write('\n')
     help_on_option(cmdclass.takes_options, outfile = outfile)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : 

More information about the bazaar mailing list