docopt / docopt.cpp

C++11 port of docopt
Boost Software License 1.0
1.05k stars 146 forks source link

DocoptLanguageError: unmatched '[' when parsing #70

Open marvel16 opened 7 years ago

marvel16 commented 7 years ago

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

jaredgrubb commented 7 years ago

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

marvel16 commented 7 years ago

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 commented 7 years ago

When i remove option description it starts working. image

image

GamePad64 commented 7 years ago

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

marvel16 commented 7 years ago

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 commented 7 years ago

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