RequireOrder: do not collect unrecognised options after a non-opt
authorSimon Marlow <simonmar@microsoft.com>
Wed, 26 Apr 2006 12:11:10 +0000 (12:11 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 26 Apr 2006 12:11:10 +0000 (12:11 +0000)
commit326d99d3ea1f73a610e92adc32f8bc43f17c947e
tree0d8b40384476067ba89ef5edb9b8e287a7d7f1a3
parentc97a57ca63193dea6ed2c6917accb8dc5f610fe0
RequireOrder: do not collect unrecognised options after a non-opt
The documentation for RequireOrder says "no option processing after
first non-option", so it doesn't seem right that we should process the
rest of the arguments to collect the unrecognised ones.  Presumably
the client wants to know about the unrecognised options up to the
first non-option, and will be using a different option parser for the
rest of the command line.

eg. before:

Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
([],["bar","--foo"],["--foo"],[])

after:

Prelude System.Console.GetOpt> getOpt' RequireOrder [] ["bar","--foo"]
([],["bar","--foo"],[],[])
System/Console/GetOpt.hs