Opened 12 years ago

Closed 11 years ago

Last modified 9 years ago

#473 closed bug (fixed)

getOpt' checks "non-option options"

Reported by: nobody Owned by: nobody
Priority: normal Milestone:
Component: libraries/base Version: 6.4.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by panne)

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:

<          procNextOpt (NonOpt x)   RequireOrder      =
>          procNextOpt (NonOpt x)   RequireOrder      =


Change History (4)

comment:1 Changed 12 years ago by nobody

Logged In: NO 

I forgot to mention, that the problem refers to the
System.Console.GetOpt module and the fix is to be applied to
the corresponding file GetOpt.hs.

comment:2 Changed 11 years ago by panne

Architecture: Unknown
Description: modified (diff)
difficulty: Unknown
Operating System: Unknown
Resolution: Nonefixed
Status: assignedclosed

The bug has already been fixed in the 6.4.2 branch, and it is now fixed in the HEAD, too.

comment:3 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:4 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.