summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-18 11:39:16 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-18 11:39:16 -0400
commitdc7e4be27070421022d7d37a9b8d13f73c7667c7 (patch)
treef239ff17ce66d4f6bd92a6be01fa039e14bfa1d4 /CmdLine.hs
parent5e81ebbd1a6f8911acd537923f2f3c1df4971bbc (diff)
downloaddebug-me-dc7e4be27070421022d7d37a9b8d13f73c7667c7.tar.gz
add --show-hashes
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