Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to allow a new line in the Option definition. #22

Closed
wants to merge 1 commit into from

Conversation

rhorenov
Copy link

Hi,

thanks for the good work on docopt.cpp.

I've submitted few pull requests to address some problems I've found while using docopt.cpp in our application.

This is again a simillar problem to pull request #23. Perhaps I should have squashed them together...

The problem manifests on platforms where '$' does not match new line e.g. Linux.

According to:

http://cplusplus.github.io/LWG/lwg-active.html#2343

some RegEx implementations e.g. GCC have multiline property turned off so '$' does not match a new line character and the Option parser fails to recognise an option's parameter if it is present.

All test are passing on gcc 5.1 and msvc2015.

Regards,
Roman

Failing example:

Usage:
    my_app [--so-long-option-that-the-description-is-on-a-new-line <param>]

Options:
    --so-long-option-that-the-description-is-on-a-new-line <param>
                         Something very important [default: 43]

modified: docopt.cpp

The problem manifests on platforms where '$' does not match new line.

According to:

  http://cplusplus.github.io/LWG/lwg-active.html#2343

some RegEx implementations e.g. GCC have multiline property
turned off so '$' does not match a new line character
and the Option parser fails to recognise an option's
parameter if it is present.

Example
=======

Usage:
    my_app [--so-long-option-that-the-description-is-on-a-new-line <param>]

Options:
    --so-long-option-that-the-description-is-on-a-new-line <param>
                         Something very important [default: 43]

	modified:   docopt.cpp
@jaredgrubb
Copy link
Member

Sorry for the delay ... I've been trying to get some of these taken care of, and would be willing to merge this. However, it looks like other pull requests have now created a merge conflict. Do you mind rebasing this and leaving a comment? Then we can have travis verify that things still look ok.

@ztdwu
Copy link

ztdwu commented May 26, 2016

Is there an update on the status of this PR? This is a very helpful feature.

@jaredgrubb
Copy link
Member

I just need a rebase of it to resolve the merge conflict.

@Camille019
Copy link

Is this PR a duplicate of PR #55?

@rhorenov rhorenov closed this Mar 26, 2019
@rhorenov rhorenov deleted the fix_new_line_in_option branch March 26, 2019 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants