bzr help CMD not printing a terminating newline

Hans Ulrich Niedermann arch at n-dimensional.de
Mon Jun 6 17:19:24 BST 2005


John A Meinel <john at arbash-meinel.com> writes:

> duchier at ps.uni-sb.de 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
http://es.lauft.net/bzr/ as usual).

AFAICT, it was just a question of:

*** modified file 'bzrlib/help.py'
--- bzrlib/help.py
+++ bzrlib/help.py
@@ -112,6 +112,8 @@ def help_on_command(cmdname, outfile = N
         outfile.write('aliases: ' + ', '.join(cmdclass.aliases) + '\n')
     
     outfile.write(doc)
+    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 : https://lists.ubuntu.com/archives/bazaar/attachments/20050606/b1d039ea/attachment.pgp 


More information about the bazaar mailing list