summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-28 17:00:17 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-28 17:00:17 -0400
commite683f156b7eb8e761c254704538914d86f309801 (patch)
treee239803c2f775cbb914a8c7db44189974728781a /CmdLine.hs
parente833b89e2a1a1c2acbc0eb8bed1760ef0e50f3c5 (diff)
downloaddebug-me-e683f156b7eb8e761c254704538914d86f309801.tar.gz
control window and chatting
Works!
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs21
1 files changed, 16 insertions, 5 deletions
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