getOpt' checks "non-option options"
When given RequireOrder the getOpt' function should not
parse options
following a non-option. But currently (as of version
6.4.1 of ghc) it
does. E.g. when parsing with RequireOrder and if
invalid-opt3 is not a
recognized option then the following produces an error:
progname --valid-opt1 --valid-opt2 non-opt --invalid-opt3
However, anything after non-opt should not be parsed.
The problem can be
fixed as follows:
164c164
< procNextOpt (NonOpt x) RequireOrder =
([],x:rest,us,[])
---
> procNextOpt (NonOpt x) RequireOrder =
([],x:rest,[],[])
Best
Sebastian
Edited by panne