summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-14 19:39:23 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-14 19:39:23 -0400
commit74003096f8018827dde28b5746a19c1e325bc68f (patch)
treede5343b6dae38d4ae06b8ad004f45b9669b28cb6 /CmdLine.hs
parent0222ca35ec03836ab216aff1a38e337e2be16511 (diff)
downloaddebug-me-74003096f8018827dde28b5746a19c1e325bc68f.tar.gz
add --graphviz mode
This commit was sponsored by Shane-o on Patreon.
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs26
1 files changed, 26 insertions, 0 deletions
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"
+ )