Attached tiny modification makes options to be not parsed after "--", and removes treating of "-foo" as "-f"

Vadim.
--- Args.hs.orig        2005-07-07 20:14:00.000000000 +0400
+++ Args.hs     2005-08-02 06:35:49.383288368 +0400
@@ -54,7 +54,7 @@
 unpackOptions :: [String] -> [String]
 unpackOptions [] = []
 unpackOptions (('-':[]):rest)  = ["-"] ++ unpackOptions rest
-unpackOptions ("--":opts) = opts
+unpackOptions ("--":opts) = ["--"] ++ opts
 unpackOptions (('-':opt):rest) = unpackOption opt ++ unpackOptions rest
 unpackOptions (filename:rest) = filename : unpackOptions rest
 
@@ -135,7 +135,8 @@
 gatherArgs("-B":backend:rest)     = [Opt "-B" backend] ++ gatherArgs(rest)
 gatherArgs("-V:":item:rest)       = [Opt "-V:" item] ++ gatherArgs(rest)
 gatherArgs(('-':[]):xs)           = [File "-"] ++ gatherArgs(xs)
-gatherArgs(('-':x):xs)            = [Switch (head x)] ++ gatherArgs(xs)
+gatherArgs(("--"):rest)           = [File x | x <- rest]
+gatherArgs(('-':x:[]):xs)         = [Switch x] ++ gatherArgs(xs)
 gatherArgs(x:xs)                  = [File x] ++ gatherArgs(xs)
 
 {- collect "-e" switches together,

Reply via email to