summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs26
1 files changed, 19 insertions, 7 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index 667693e..77f65f8 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -6,16 +6,28 @@ data CmdLine = CmdLine
{ mode :: Mode
}
-data Mode = Test | Graphviz FilePath
+data Mode
+ = Test
+ | Graphviz GraphvizOpts
+
+data GraphvizOpts = GraphvizOpts
+ { graphvizLogFile :: FilePath
+ , graphvizShowHashes :: Bool
+ }
parseCmdLine :: Parser CmdLine
-parseCmdLine = CmdLine <$> (parsegraphviz <|> pure Test)
+parseCmdLine = CmdLine <$> ((Graphviz <$> parsegraphviz) <|> pure Test)
where
- parsegraphviz = Graphviz <$> option str
- ( long "graphviz"
- <> metavar "logfile"
- <> help "visualize log file with graphviz"
- )
+ parsegraphviz = GraphvizOpts
+ <$> option str
+ ( long "graphviz"
+ <> metavar "logfile"
+ <> help "visualize log file with graphviz"
+ )
+ <*> switch
+ ( long "show-hashes"
+ <> help "display hashes in graphviz"
+ )
getCmdLine :: IO CmdLine
getCmdLine = execParser opts