summaryrefslogtreecommitdiff
path: root/src/GF/Command/Commands.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2008-01-08 12:22:05 +0000
committeraarne <aarne@cs.chalmers.se>2008-01-08 12:22:05 +0000
commit327c63eb741606adf5d7d98cd32b731f6bda7ae7 (patch)
tree898c6c4ada7e1d3283bd13333a1d7367748cbaa5 /src/GF/Command/Commands.hs
parent12144083879e174d8d8176f2c37ea0aaf1a3d948 (diff)
gt command in gf3
Diffstat (limited to 'src/GF/Command/Commands.hs')
-rw-r--r--src/GF/Command/Commands.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/GF/Command/Commands.hs b/src/GF/Command/Commands.hs
index f89a3d111..573b15eb1 100644
--- a/src/GF/Command/Commands.hs
+++ b/src/GF/Command/Commands.hs
@@ -91,6 +91,15 @@ allCommands mgr = Map.fromAscList [
ts <- generateRandom mgr (optCat opts)
return $ fromTrees $ take (optNum opts) ts
}),
+ ("gt", emptyCommandInfo {
+ longname = "generate_trees",
+ synopsis = "generates a list of trees, by default exhaustive",
+ flags = ["cat","depth","number"],
+ exec = \opts _ -> do
+ let dp = return $ valIntOpts "depth" 4 opts
+ let ts = generateAllDepth mgr (optCat opts) dp
+ return $ fromTrees $ take (optNumInf opts) ts
+ }),
("h", emptyCommandInfo {
longname = "help",
synopsis = "get description of a command, or a the full list of commands",
@@ -134,6 +143,7 @@ allCommands mgr = Map.fromAscList [
lang -> [lang]
optCat opts = valIdOpts "cat" (lookAbsFlag gr (cid "startcat")) opts
optNum opts = valIntOpts "number" 1 opts
+ optNumInf opts = valIntOpts "number" 1000000000 opts ---- 10^9
gr = gfcc mgr