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

DocoptLanguageError: unmatched '[' when parsing

Open marvel16 opened this issue 8 years ago • 6 comments

I'm trying to understand which part of usage fails could you please help? It seems to be failing on [(-s ( OPT1 OPT2)...)] // want -s option to be optional and if it is specified it must go with key-value pairs OPT1 OPT2 but i can't get it working. Can someone help? Thanks

image

marvel16 avatar Feb 08 '17 18:02 marvel16

I think that should work, but I'm not sure.

jaredgrubb avatar Feb 09 '17 21:02 jaredgrubb

Hey, i have updates, figured out that the issue is in how i describe -s in options. When i remove this tag line from Options: parser stops throwing DocoptLanguageError: unmatched '['

But how do i describe Option for user ?=D

Would be appreciated for help!

marvel16 avatar Feb 10 '17 09:02 marvel16

When i remove option description it starts working. image

image

marvel16 avatar Feb 10 '17 11:02 marvel16

So, docopt.cpp is pretty good in resembling upstream =) You should file an issue there first.

GamePad64 avatar Feb 10 '17 11:02 GamePad64

GamePad64, what do you mean?=D

Srsly i don't understand why doesn't it work when i add Options: description string with -s parameter...

marvel16 avatar Feb 10 '17 11:02 marvel16

If you are using C++ default settings for Options: section, note that tab will insert tabs, not spaces. And options require at least 2 spaces between arguments and its description

marvel16 avatar Feb 15 '17 17:02 marvel16