diff --git a/testcases.docopt b/testcases.docopt index 8bc44080..5b388d1b 100644 --- a/testcases.docopt +++ b/testcases.docopt @@ -2774,3 +2774,40 @@ $ prog --foo $ prog --foo=abc {"--foo": "abc"} +# Fix issue #34 +# Option parser trips up if `--` is preseent in description RHS + +r""" +usage: foo [options] +options: + --foo This is foo. Not applicable if --qux is given. + --bar This is bar. +""" + +$ prog --bar +{"--bar": true} + +r""" +usage: foo [options] +options: + this is command. + --foo This is foo. Not applicable if --qux is given. + --bar This is bar. +""" + +$ prog --bar run +{"--bar": true, "": "run", "COMMAND": "run"} + +$ prog --bar +{"--bar": true} + +r""" +usage: foo [options] +options: + --foo This is foo. Not applicable if --qux is given. + this is command. + --bar This is bar. +""" + +$ prog --bar run +{"--bar": true, "": "run", "COMMAND": "run"}