GetOpt is broken

Volker Wysk post at volker-wysk.de
Tue Apr 12 04:37:44 EDT 2005


Hello.

In GHC 6.4, GetOpt no longer recognizes the "--" argument, which terminates 
interpretation of arguments beginning with "-" as switches:


import System.Console.GetOpt
import System

main = do
   args <- getArgs
   let (_,_,f) = getOpt Permute [Option "a" [] (OptArg (const ()) "xxx") ""]
                        args
   print f


/tmp $ ./getopt -- -1
["unrecognized option `-1'\n"]


It works okay with GHC 6.2.2.

Bye,
V.W.



More information about the Glasgow-haskell-bugs mailing list