diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-18 11:39:16 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-18 11:39:16 -0400 |
commit | dc7e4be27070421022d7d37a9b8d13f73c7667c7 (patch) | |
tree | f239ff17ce66d4f6bd92a6be01fa039e14bfa1d4 /CmdLine.hs | |
parent | 5e81ebbd1a6f8911acd537923f2f3c1df4971bbc (diff) | |
download | debug-me-dc7e4be27070421022d7d37a9b8d13f73c7667c7.tar.gz |
add --show-hashes
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 |