summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
blob: 667693e3bcbe04f82899243687e7a1c971b366f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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"
		)