splot 0.3.3 → 0.3.4
raw patch · 2 files changed
+23/−6 lines, 2 filesdep +template-haskelldep +vcs-revision
Dependencies added: template-haskell, vcs-revision
Files
- Tools/SPlotMain.hs +21/−4
- splot.cabal +2/−2
Tools/SPlotMain.hs view
@@ -1,5 +1,11 @@+{-# LANGUAGE TemplateHaskell #-} module Main where +import Paths_splot (version)+import Data.Version (showVersion)+import Distribution.VcsRevision.Git+import Language.Haskell.TH.Syntax+ import System.Environment (getArgs) import System.Exit @@ -27,11 +33,14 @@ showHelp = mapM_ putStrLn [ "splot - a tool for visualizing the lifecycle of many concurrent multi-stage processes. See http://www.haskell.org/haskellwiki/Splot",- "Usage: splot [-if INFILE] [-o PNGFILE] [-w WIDTH] [-h HEIGHT] [-bh BARHEIGHT] ",+ "Usage: splot [--help] [--version]",+ " [-if INFILE] [-o PNGFILE] [-w WIDTH] [-h HEIGHT] [-bh BARHEIGHT] ", " [-tf TIMEFORMAT] [-expire EXPIRE]", " [-fromTime TIME] [-toTime TIME] [-numTracks NUMTRACKS]", " [-tickInterval TICKINTERVAL] [-largeTickFreq N]", " [-colorscheme SCHEME COLORS]...",+ " --help - show help",+ " --version - show version", " -if INFILE - filename from where to read the trace.", " -o PNGFILE - filename to which the output will be written in PNG format. Required.", " -w, -h - width and height of the resulting picture. Default 640x480.",@@ -95,11 +104,19 @@ "" ] +showGitVersion = $(do+ v <- qRunIO getRevision+ lift $ case v of+ Nothing -> "<none>"+ Just (hash,True) -> hash ++ " (with local modifications)"+ Just (hash,False) -> hash)+ main = do args <- getArgs- case args of- ["--help"] -> showHelp >> exitSuccess- _ -> return ()+ when (null args || args == ["--help"]) $ showHelp >> exitSuccess+ when (null args || args == ["--version"]) $ do+ putStrLn ("This is timeplot-" ++ showVersion version ++ " (git " ++ showGitVersion ++ ")") >> exitSuccess+ let (w,h) = (read $ getArg "w" "640" args, read $ getArg "h" "480" args) let barHeight = case getArg "bh" "fill" args of { "fill" -> BarHeightFill ; bh -> BarHeightFixed $ read bh } let tickIntervalMs = read $ getArg "tickInterval" "1000" args
splot.cabal view
@@ -1,5 +1,5 @@ Name: splot-Version: 0.3.3+Version: 0.3.4 License: BSD3 License-file: LICENSE Copyright: Eugene Kirpichov, 2010@@ -28,7 +28,7 @@ Build-Depends: base < 3 Build-Depends: cairo, bytestring, bytestring-lexing, strptime >= 0.1.7, time, - containers, colour, Chart, mtl, HUnit+ containers, colour, Chart, mtl, HUnit, template-haskell, vcs-revision Other-Modules: Tools.ColorMap Tools.SPlotTest Tools.SPlotTest Tools.StatePlot Main-Is: Tools/SPlotMain.hs Ghc-Options: -O2 -rtsopts