diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-28 17:00:17 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-28 17:00:17 -0400 |
commit | e683f156b7eb8e761c254704538914d86f309801 (patch) | |
tree | e239803c2f775cbb914a8c7db44189974728781a /CmdLine.hs | |
parent | e833b89e2a1a1c2acbc0eb8bed1760ef0e50f3c5 (diff) | |
download | debug-me-e683f156b7eb8e761c254704538914d86f309801.tar.gz |
control window and chatting
Works!
Diffstat (limited to 'CmdLine.hs')
-rw-r--r-- | CmdLine.hs | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -16,6 +16,7 @@ data Mode | GraphvizMode GraphvizOpts | ReplayMode ReplayOpts | ServerMode ServerOpts + | ControlMode ControlOpts data UserOpts = UserOpts { gpgOpts :: [String] @@ -50,6 +51,10 @@ data ServerOpts = ServerOpts , serverPort :: Port } +data ControlOpts = ControlOpts + { controlWindow :: Bool + } + parseCmdLine :: Parser CmdLine parseCmdLine = CmdLine <$> parseMode @@ -61,6 +66,7 @@ parseMode = (UserMode <$> parseuser) <|> (WatchMode <$> parsewatch) <|> (GraphvizMode <$> parsegraphviz) <|> (ServerMode <$> parseserver) + <|> (ControlMode <$> parsecontrol) where parseuser = UserOpts <$> many (option str @@ -71,6 +77,12 @@ parseMode = (UserMode <$> parseuser) <*> optional ((,) <$> strArgument (metavar "cmd") <*> many (strArgument (metavar "opts"))) + parsedeveloper = DeveloperOpts + <$> option str + ( long "debug" + <> metavar "url" + <> help "debug a user on the given url" + ) parsegraphviz = GraphvizOpts <$> option str ( long "graphviz" @@ -112,11 +124,10 @@ parseMode = (UserMode <$> parseuser) <> showDefault <> help "port for server to listen on" ) - parsedeveloper = DeveloperOpts - <$> option str - ( long "debug" - <> metavar "url" - <> help "debug a user on the given url" + parsecontrol = ControlOpts + <$> switch + ( long "control" + <> help "control running debug-me session" ) getCmdLine :: IO CmdLine |