flag -env=quotes (and possible other flags) to restrict ps

This commit is contained in:
aarne
2009-03-18 12:49:46 +00:00
parent 045c70c7bb
commit 30cd3704dc
3 changed files with 24 additions and 6 deletions

View File

@@ -56,6 +56,12 @@ isOpt o opts = elem o [x | OOpt x <- opts]
isFlag :: String -> [Option] -> Bool
isFlag o opts = elem o [x | OFlag x _ <- opts]
optsAndFlags :: [Option] -> ([Option],[Option])
optsAndFlags = foldr add ([],[]) where
add o (os,fs) = case o of
OOpt _ -> (o:os,fs)
OFlag _ _ -> (os,o:fs)
prOpt :: Option -> String
prOpt o = case o of
OOpt i -> i