summaryrefslogtreecommitdiff
path: root/src/GF/Command
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2009-11-20 15:14:41 +0000
committeraarne <aarne@chalmers.se>2009-11-20 15:14:41 +0000
commit6b0a662c35856beb306f0c873869e4a0e02165ef (patch)
tree7197a8876c9d3f2dba482a2fac0163727c640abb /src/GF/Command
parent0ddf8ff18d1bca99e925873f7927ffe64376aebc (diff)
restored a parsing grammar api/Browse
Diffstat (limited to 'src/GF/Command')
-rw-r--r--src/GF/Command/Commands.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs
index 9d3fd3299..228b40c37 100644
--- a/src/GF/Command/Commands.hs
+++ b/src/GF/Command/Commands.hs
@@ -480,9 +480,10 @@ allCommands cod env@(pgf, mos) = Map.fromList [
examples = [
"pt -compute (plus one two) -- compute value"
],
- exec = \opts -> returnFromExprs . treeOps opts,
+ exec = \opts ->
+ returnFromExprs . takeOptNum opts . treeOps opts,
options = treeOpOptions pgf,
- flags = treeOpFlags pgf
+ flags = [("number","take at most this many trees")] ++ treeOpFlags pgf
}),
("q", emptyCommandInfo {
longname = "quit",
@@ -821,7 +822,8 @@ allCommands cod env@(pgf, mos) = Map.fromList [
optViewGraph opts = valStrOpts "view" "open" opts
optNum opts = valIntOpts "number" 1 opts
optNumInf opts = valIntOpts "number" 1000000000 opts ---- 10^9
-
+ takeOptNum opts = take (optNumInf opts)
+
fromExprs es = (es,unlines (map (showExpr []) es))
fromStrings ss = (map (ELit . LStr) ss, unlines ss)
fromString s = ([ELit (LStr s)], s)