summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs18
1 files changed, 17 insertions, 1 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index 77f65f8..2cfea7a 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -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