Opened 10 years ago

Closed 9 years ago

Last modified 7 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: Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

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:

164c164
<          procNextOpt (NonOpt x)   RequireOrder      =
([],x:rest,us,[])
---
>          procNextOpt (NonOpt x)   RequireOrder      =
([],x:rest,[],[])

Best
Sebastian

Change History (4)

comment:1 Changed 10 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 9 years ago by panne

  • Architecture set to Unknown
  • Description modified (diff)
  • difficulty set to Unknown
  • Operating System set to Unknown
  • Resolution changed from None to fixed
  • Status changed from assigned to closed

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

comment:3 Changed 7 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:4 Changed 7 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.