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" )