Closed Mike-Crowe-BrightSign closed 6 years ago
Sorry it's taken so long to get to look at this.
The issue here is that the first arg position (to parse({ ... })
) should be the exe name. Because you're missing it, in the first case the -f
is being treated as the exe name (and you're not checking that the flag was set). In the other cases the-filename
takes the position of the filename, and hence is not setting the variable.
So Clara is working as intended. In any case I've added something similar (but fixed) to your tests to the test suite:
https://github.com/catchorg/Clara/commit/3ba504c3020b2728ac6c47021892143ab75d9c9e
I'm having trouble getting Clara to recognise a single positional argument.
Adding this to ClaraTests.cpp:
Fails with:
Compared the the other tests, I can't see what I'm doing wrong. :(