diff options
Diffstat (limited to 'CmdLine.hs')
-rw-r--r-- | CmdLine.hs | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -9,14 +9,24 @@ data CmdLine = CmdLine data Mode = Test | Graphviz GraphvizOpts + | Replay ReplayOpts data GraphvizOpts = GraphvizOpts { graphvizLogFile :: FilePath , graphvizShowHashes :: Bool } +data ReplayOpts = ReplayOpts + { replayLogFile :: FilePath + } + parseCmdLine :: Parser CmdLine -parseCmdLine = CmdLine <$> ((Graphviz <$> parsegraphviz) <|> pure Test) +parseCmdLine = CmdLine <$> parseMode + +parseMode :: Parser Mode +parseMode = (Graphviz <$> parsegraphviz) + <|> (Replay <$> parsereplay) + <|> pure Test where parsegraphviz = GraphvizOpts <$> option str @@ -28,6 +38,12 @@ parseCmdLine = CmdLine <$> ((Graphviz <$> parsegraphviz) <|> pure Test) ( long "show-hashes" <> help "display hashes in graphviz" ) + parsereplay = ReplayOpts + <$> option str + ( long "replay" + <> metavar "logfile" + <> help "replay log file" + ) getCmdLine :: IO CmdLine getCmdLine = execParser opts |