From 74003096f8018827dde28b5746a19c1e325bc68f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 14 Apr 2017 19:39:23 -0400 Subject: add --graphviz mode This commit was sponsored by Shane-o on Patreon. --- CmdLine.hs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 CmdLine.hs (limited to 'CmdLine.hs') diff --git a/CmdLine.hs b/CmdLine.hs new file mode 100644 index 0000000..667693e --- /dev/null +++ b/CmdLine.hs @@ -0,0 +1,26 @@ +module CmdLine where + +import Options.Applicative + +data CmdLine = CmdLine + { mode :: Mode + } + +data Mode = Test | Graphviz FilePath + +parseCmdLine :: Parser CmdLine +parseCmdLine = CmdLine <$> (parsegraphviz <|> pure Test) + where + parsegraphviz = Graphviz <$> option str + ( long "graphviz" + <> metavar "logfile" + <> help "visualize log file with graphviz" + ) + +getCmdLine :: IO CmdLine +getCmdLine = execParser opts + where + opts = info (helper <*> parseCmdLine) + ( fullDesc + <> header "debug-me - provable remote debugging sessions" + ) -- cgit v1.2.3