docopt / docopt.hs

A command-line interface description language and parser that will make you smile
http://docopt.org/
MIT License
119 stars 24 forks source link

Options aren't found if <argument> is too long #16

Closed alexchandel closed 8 years ago

alexchandel commented 9 years ago

Consider the usage text:

Usage:
  foo <argument>
  foo --help

Options:
  -h, --help        Print this message.
  -v, --verbose     Print extra warnings and information.

When invoked as foo --help or as foo -h, (isPresent args (longOption "help")) will return false. This is unsettling.

alexchandel commented 9 years ago

The important thing to note is that if <argument> is shortened to <bar>, this doesn't misbehave.

ryanartecona commented 9 years ago

I will try to reproduce this to be safe, but at face value this looks like the same issue I just described in my response to #17. Are you sure you hit this issue by changing nothing but <argument> to <bar>?

ryanartecona commented 8 years ago

I was able to reproduce this, and have a fix incoming which will be in the next release.