From e683f156b7eb8e761c254704538914d86f309801 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 28 Apr 2017 17:00:17 -0400 Subject: control window and chatting Works! --- CmdLine.hs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'CmdLine.hs') diff --git a/CmdLine.hs b/CmdLine.hs index a2f900b..42c28ee 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -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 -- cgit v1.2.3