labels read from config files for dependency trees, eg lib/src/dep.labels

This commit is contained in:
aarne
2009-10-19 15:53:30 +00:00
parent 79e4d6ebf8
commit f37d5a0f65
4 changed files with 120 additions and 18 deletions

View File

@@ -579,8 +579,14 @@ allCommands cod env@(pgf, mos) = Map.fromList [
"flag -format."
],
exec = \opts es -> do
let debug = isOpt "v" opts
let file = valStrOpts "file" "" opts
mlab <- case file of
"" -> return Nothing
_ -> readFile file >>= return . Just . getDepLabels . lines
let lang = optLang opts
let grph = if null es then [] else dependencyTree Nothing pgf lang (head es)
let grph = if null es then [] else
dependencyTree debug mlab Nothing pgf lang (head es)
if isFlag "view" opts || isFlag "format" opts then do
let file s = "_grph." ++ s
let view = optViewGraph opts ++ " "
@@ -595,8 +601,10 @@ allCommands cod env@(pgf, mos) = Map.fromList [
"gr | vt -view=\"open\" -- generate a tree and display alignment on a Mac"
],
options = [
("v","show extra information")
],
flags = [
("file","configuration file for labels per fun, format 'fun l1 ... label ... l2'"),
("format","format of the visualization file (default \"png\")"),
("view","program to open the resulting file (default \"open\")")
]