dbuenzli / cmdliner

Declarative definition of command line interfaces for OCaml
http://erratique.ch/software/cmdliner
ISC License
296 stars 56 forks source link

How to format Arg.info doc? #180

Open glacambre opened 1 year ago

glacambre commented 1 year ago

Dear maintainer,

Thank you for maintaining Cmdliner. It is a wonderful library and possibly one of the most ergonomic ones I've ever used :).

I am encountering an issue which I couldn't figure out a solution to. I have an option (Cmdliner.Arg) whose documentation (info.doc) is a little big and not very readable. I would like to insert linebreaks or split it into multiple sections.

I tried many things: inserting \ns, escaping them, putting them in markup, raw groff, escaped raw groff... nothing worked. Reading the Documentation Markup Language section of cmdliner's documentation, I'm under the impression that what I am trying to achieve is simply not currently possible.

Am I mistaken? If yes, what would be the right way to provide more formatting for an Arg.info's doc?

dbuenzli commented 1 year ago

Sorry @glacambre it seems I missed your request. No I don't think you are mistaken.

Currently this is being used to render options docs. I'm not sure whether this is amenable to multiparagraphs but it's not an unreasonable request. (I see git's manpages do seem to have multi paragraph option descriptions so something must be amenable to it but I'm no groff expert).

Starting a new paragraph after "\n\n" would feel reasonably backwards compatible to me.