diff --git a/src/GF/Shell.hs b/src/GF/Shell.hs index ac5a5d660..8ae01017c 100644 --- a/src/GF/Shell.hs +++ b/src/GF/Shell.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/06/20 16:14:19 $ +-- > CVS $Date: 2005/07/01 08:16:32 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.41 $ +-- > CVS $Revision: 1.42 $ -- -- GF shell command interpreter. ----------------------------------------------------------------------------- @@ -208,6 +208,8 @@ execC co@(comm, opts0) sa@((st,(h,_)),a) = checkOptions st co >> case comm of _ -> Nothing returnArg (ATrms $ generateTrees opts gro mt) sa + CShowTreeGraph | oElem emitCode opts -> do -- -o + returnArg (AString $ visualizeTrees opts $ strees $ s2t a) sa CShowTreeGraph -> do let g0 = writeFile "grphtmp.dot" $ visualizeTrees opts $ strees $ s2t a g1 = system "dot -Tps grphtmp.dot >grphtmp.ps" diff --git a/src/GF/Shell/HelpFile.hs b/src/GF/Shell/HelpFile.hs index 6a95ff7bf..6a1b55d33 100644 --- a/src/GF/Shell/HelpFile.hs +++ b/src/GF/Shell/HelpFile.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/06/20 16:14:19 $ +-- > CVS $Date: 2005/07/01 08:16:32 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.6 $ +-- > CVS $Revision: 1.7 $ -- -- Help on shell commands. Generated from HelpFile by 'make help'. -- PLEASE DON'T EDIT THIS FILE. @@ -317,6 +317,11 @@ txtHelpFile = "\n -c show categories only (no functions)" ++ "\n -f show functions only (no categories)" ++ "\n -g show as graph (sharing uses of the same function)" ++ + "\n -o just generate the .dot file" ++ + "\n examples:" ++ + "\n p \"hello world\" | vt -o | wf my.dot ;; ! open -a GraphViz my.dot" ++ + "\n -- This writes the parse tree into my.dot and opens the .dot file" ++ + "\n -- with another application without generating .ps." ++ "\n" ++ "\n-- subshells" ++ "\n" ++ diff --git a/src/GF/Shell/ShellCommands.hs b/src/GF/Shell/ShellCommands.hs index e2b809b21..9d6718faf 100644 --- a/src/GF/Shell/ShellCommands.hs +++ b/src/GF/Shell/ShellCommands.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/06/20 16:14:20 $ +-- > CVS $Date: 2005/07/01 08:16:32 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.38 $ +-- > CVS $Revision: 1.39 $ -- -- The datatype of shell commands and the list of their options. ----------------------------------------------------------------------------- @@ -191,7 +191,7 @@ optionsOfCommand co = case co of CSpeakAloud -> flags "language" CPutString -> both "utf8" "filter length" CShowTerm -> flags "printer" - CShowTreeGraph -> opts "c f g" + CShowTreeGraph -> opts "c f g o" CSystemCommand _ -> none CPrintGrammar -> both "utf8" "printer lang" diff --git a/src/HelpFile b/src/HelpFile index dcd246858..03a1c1be5 100644 --- a/src/HelpFile +++ b/src/HelpFile @@ -288,6 +288,11 @@ vt, visualize_tree: vt Tree -c show categories only (no functions) -f show functions only (no categories) -g show as graph (sharing uses of the same function) + -o just generate the .dot file + examples: + p "hello world" | vt -o | wf my.dot ;; ! open -a GraphViz my.dot + -- This writes the parse tree into my.dot and opens the .dot file + -- with another application without generating .ps. -- subshells