#163 manpage usage synopsis cut short: too many args to .BI

output: manpages
open
XSL (122)
7
2009-02-10
2009-02-10
Oliver Kiddle
No

In some man pages, the usage synopsis is being cut short with later parameters lost. This is because the .BI macro can only take up to 6 arguments. (see http://www.linux.com/feature/34212\)

The solution is to use multiple .BI lines with a \c at the end of all but the last line to avoid adding extra spaces. This \c doesn't actually appear to work on Solaris but a spurious space (before a comma separator or the closing parenthesis) is a lot better than missing parameters.

I have attached a patch. It can perhaps be done more elegantly using exsl:node-set if you prefer.

Discussion

  • Oliver Kiddle
    Oliver Kiddle
    2009-02-10

    patch to split lines where more than 6 arguments appear

     
    Attachments
  • Thanks for catching this. I had no idea that there were limits to the number of arguments to .BI on some systems. But I should have checked the docs, because I see from looking at groff man(7) that it says, "Traditionally, each command can have up to six arguments, but the GNU implementation removes this limitation (you might still want to limit yourself to 6 arguments for portability's sake)."

    So, I do need to get this fixed. But I definitely won't be able to until after the 1.74.1 release this week.

    I very much appreciate you reporting these portability issues. I used to have access to a Solaris environment, and do again now, but for a long time I did not and so was not able to test on Solaris some of the changes I made over the past couple years. I fear there are probably a few more lurking that we've not found yet.

     
    • priority: 5 --> 7
    • assigned_to: nobody --> xmldoc
     
  • Oliver Kiddle
    Oliver Kiddle
    2009-02-10

    I've just noticed that the solution to making the \c work on Solaris is to put it inside the double quotes. To adapt my patch, simply change the line:
    <xsl:text>"\c&#10;.</xsl:text>
    to:
    <xsl:text>\c"&#10;.</xsl:text>

     
  • Oliver - OK, thanks. BTW, do you have some DocBook XML source that you can provide for me to test with? It's fine if you need to obfuscate the contents or whatever. I'd just like to have a test file I can use that matches what you really need.

     
  • Oliver Kiddle
    Oliver Kiddle
    2009-02-11

     
    Attachments
  • Oliver Kiddle
    Oliver Kiddle
    2009-02-11

    I've attached some example XML source.

    With the more recent versions of docbook-xsl, I see that I can select K&R style for the synopsis which makes sense for Fortran. However, the problem occurs also with a C or C++ function synopsis.
    File Added: example.xml