summaryrefslogtreecommitdiff
path: root/src-3.0/GF/Command/Abstract.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-06-18 16:26:12 +0000
committeraarne <aarne@cs.chalmers.se>2008-06-18 16:26:12 +0000
commit944eea8de9e077d1b3ee1a9edad9c52e9dbc2bd0 (patch)
tree82f128532a90a8e745e4ebc1875eeb7a8f9b0701 /src-3.0/GF/Command/Abstract.hs
parent8e5b78f886065d082677101b28c44d7980763eb0 (diff)
system command pipes (sp)
Diffstat (limited to 'src-3.0/GF/Command/Abstract.hs')
-rw-r--r--src-3.0/GF/Command/Abstract.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src-3.0/GF/Command/Abstract.hs b/src-3.0/GF/Command/Abstract.hs
index 2b9ce5d1d..8643a649f 100644
--- a/src-3.0/GF/Command/Abstract.hs
+++ b/src-3.0/GF/Command/Abstract.hs
@@ -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