diff options
Diffstat (limited to 'CmdLine.hs')
-rw-r--r-- | CmdLine.hs | 26 |
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" + ) |