diff options
Diffstat (limited to 'src/GF/Command/Abstract.hs')
| -rw-r--r-- | src/GF/Command/Abstract.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/GF/Command/Abstract.hs b/src/GF/Command/Abstract.hs index cf82e96c6..dff404194 100644 --- a/src/GF/Command/Abstract.hs +++ b/src/GF/Command/Abstract.hs @@ -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 |
