docopt.cpp icon indicating copy to clipboard operation
docopt.cpp copied to clipboard

Empty lines do not break options sections.

Open EVGVir opened this issue 9 years ago • 4 comments

There are several reasons why an options section can be split by an empty line, among them are:

  • logically grouping;
  • aesthetic reasons.

Such style is used, for example, in man program.

An example:

Options:
  --before-empty-lines  An option before empty lines.

  --after-empty-lines   An option after empty lines.

EVGVir avatar Aug 01 '16 22:08 EVGVir

It is possible to play with this new regular expression here.

EVGVir avatar Aug 01 '16 22:08 EVGVir

Although I think there's merit to this request, adding this test-case causes the Python version of docopt to fail. One of the missions is to maintain feature parity across the variants of docopt. Can you post this in the docopt-py forum; if it's accepted there, then I can accept your patch as the port of that feature.

jaredgrubb avatar Aug 02 '16 04:08 jaredgrubb

I have created a pull request in the main docopt repository.

EVGVir avatar Aug 03 '16 07:08 EVGVir

Something went wrong with Boost regexs. Other tests are okay.

EVGVir avatar Aug 04 '16 22:08 EVGVir