summaryrefslogtreecommitdiff
path: root/src-3.0/GF/Command
diff options
context:
space:
mode:
Diffstat (limited to 'src-3.0/GF/Command')
-rw-r--r--src-3.0/GF/Command/Abstract.hs5
-rw-r--r--src-3.0/GF/Command/Commands.hs8
2 files changed, 13 insertions, 0 deletions
diff --git a/src-3.0/GF/Command/Abstract.hs b/src-3.0/GF/Command/Abstract.hs
index 1f72688a0..31858a1f9 100644
--- a/src-3.0/GF/Command/Abstract.hs
+++ b/src-3.0/GF/Command/Abstract.hs
@@ -46,3 +46,8 @@ valOpts flag def opts = case lookup flag flags of
isOpt :: String -> [Option] -> Bool
isOpt o opts = elem o [x | OOpt x <- opts]
+
+prOpt :: Option -> String
+prOpt (OOpt i) = i ----
+
+
diff --git a/src-3.0/GF/Command/Commands.hs b/src-3.0/GF/Command/Commands.hs
index 2a15be1c9..231f6db77 100644
--- a/src-3.0/GF/Command/Commands.hs
+++ b/src-3.0/GF/Command/Commands.hs
@@ -20,6 +20,7 @@ import GF.Infra.UseIO
import GF.Data.ErrM ----
import PGF.ExprSyntax (readExp)
import GF.Command.Abstract
+import GF.Text.Lexing
import Data.Maybe
import qualified Data.Map as Map
@@ -196,6 +197,13 @@ allCommands pgf = Map.fromList [
"example:\n"++
" ph | wf foo.hist -- save the history into a file"
}),
+ ("ps", emptyCommandInfo {
+ longname = "put_string",
+ synopsis = "return a string, possibly processed with a function",
+ exec = \opts ->
+ return . fromString . maybe id id (stringOp (concatMap prOpt opts)) . toString,
+ flags = ["cat","lang"]
+ }),
("q", emptyCommandInfo {
longname = "quit",
synopsis = "exit GF interpreter"