diff options
Diffstat (limited to 'CmdLine.hs')
-rw-r--r-- | CmdLine.hs | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -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 |