diff tests/test-help.t @ 20654:af9d9b778550

minirst: create valid output when table data contains a newline When table data contained a newline, the result of minirst.maketable did not look nice plus it was not recognised by minirst.format: == === ==== l1 1 one l2 2 2 22 l3 == === ==== This problem occurred when the description of options had a very long translation which was split by newlines. Do not bother a translator with this detail. The multiline translations for option descriptions have been fixed in baf1600adfbe in it.po, de.po and ro.po. I manually did the same as this patch does, I removed the newlines. When a newline was in the description, this created unusable help output: $ hg help somecommand hg somecommand [option]... with somecommand, you can... options: == =================== ======================================================= =================================== --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -n --norm normal desc --newline VALUE line1 line2 == =================== =============== =========================================================================== now this looks much nicer: ... options: --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -n --norm normal desc --newline VALUE line1 line2
author Simon Heimberg <simohe@besonet.ch>
date Wed, 19 Feb 2014 17:32:21 +0100
parents 23146e4d9cee
children 19e9478c1a22
line wrap: on
line diff
--- a/tests/test-help.t	Wed Mar 05 14:03:08 2014 +0100
+++ b/tests/test-help.t	Wed Feb 19 17:32:21 2014 +0100
@@ -657,7 +657,10 @@
   >     pass
   > 
   > cmdtable = {
-  >     "nohelp": (nohelp, [], "hg nohelp"),
+  >     "nohelp": (nohelp, [('', 'longdesc', 3, 'x'*90),
+  >                         ('n', '', None, 'normal desc'),
+  >                         ('', 'newline', '', 'line1\nline2'),
+  >                        ], "hg nohelp"),
   > }
   > 
   > commands.norepo += ' nohelp'
@@ -672,6 +675,13 @@
   
   (no help text available)
   
+  options:
+  
+      --longdesc VALUE xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+                       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (default: 3)
+   -n --               normal desc
+      --newline VALUE  line1 line2
+  
   use "hg -v help nohelp" to show the global options
 
   $ hg help -k nohelp