forked from GitHub/gf-core
system command pipes (sp)
This commit is contained in:
@@ -20,6 +20,7 @@ data Option
|
||||
data Value
|
||||
= VId Ident
|
||||
| VInt Integer
|
||||
| VStr String
|
||||
deriving (Eq,Ord,Show)
|
||||
|
||||
data Argument
|
||||
@@ -38,6 +39,11 @@ valIntOpts flag def opts = fromInteger $ case valOpts flag (VInt def) opts of
|
||||
VInt v -> v
|
||||
_ -> def
|
||||
|
||||
valStrOpts :: String -> String -> [Option] -> String
|
||||
valStrOpts flag def opts = case valOpts flag (VStr def) opts of
|
||||
VStr v -> v
|
||||
_ -> def
|
||||
|
||||
valOpts :: String -> Value -> [Option] -> Value
|
||||
valOpts flag def opts = case lookup flag flags of
|
||||
Just v -> v
|
||||
|
||||
Reference in New Issue
Block a user