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

Argument names with characters other than letters (like underscores or numbers) don't work #147

Open
ericonr opened this issue Feb 14, 2022 · 1 comment

Comments

@ericonr
Copy link

ericonr commented Feb 14, 2022

#include "docopt.h"

static const char usage[] =
R"(Usage:
    underscore -a BASE_ADDRESS
)";


int main(int argc, char *argv[])
{
    auto args = docopt::docopt(usage, {argv+1, argv+argc}, true);
}

This prints:

$ ./underscore -a 1
Arguments did not match expected patterns
Usage:
    underscore -a BASE_ADDRESS

If BASE_ADDRESS becomes BASE1ADDRESS or BASE-ADDRESS, the error still happens.

This should be either documented or fixed, I think.

@jaredgrubb
Copy link
Member

I think this would be a good enhancement.

ericonr added a commit to lnls-dig/uhal that referenced this issue Apr 20, 2022
Doesn't suffer from bugs found in docopt (at least [1] and [2]), has
more active development and a better API.

Needs to be updated to argparse 2.3 (per [3]) to actually compile.

[1] docopt/docopt.cpp#147
[2] docopt/docopt.cpp#148
[3] mesonbuild/wrapdb#393
ericonr added a commit to lnls-dig/uhal that referenced this issue May 20, 2022
Doesn't suffer from bugs found in docopt (at least [1] and [2]), has
more active development and a better API.

[1] docopt/docopt.cpp#147
[2] docopt/docopt.cpp#148
ericonr added a commit to lnls-dig/uhal that referenced this issue Jun 3, 2022
Doesn't suffer from bugs found in docopt (at least [1] and [2]), has
more active development and a better API.

[1] docopt/docopt.cpp#147
[2] docopt/docopt.cpp#148
ericonr added a commit to lnls-dig/uhal that referenced this issue Aug 19, 2022
Doesn't suffer from bugs found in docopt (at least [1] and [2]), has
more active development and a better API.

[1] docopt/docopt.cpp#147
[2] docopt/docopt.cpp#148
ericonr added a commit to lnls-dig/uhal that referenced this issue Sep 9, 2022
Doesn't suffer from bugs found in docopt (at least [1] and [2]), has
more active development and a better API.

[1] docopt/docopt.cpp#147
[2] docopt/docopt.cpp#148
ericonr added a commit to lnls-dig/uhal that referenced this issue Sep 9, 2022
Doesn't suffer from bugs found in docopt (at least [1] and [2]), has
more active development and a better API.

[1] docopt/docopt.cpp#147
[2] docopt/docopt.cpp#148
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants