summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-21 22:23:00 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-21 22:24:51 -0400
commit75c8b6b9745ea8e64383e28d3f18b1609be00fa3 (patch)
tree3cdbe871bf78eddb38307def309e5a982234fdc1 /CmdLine.hs
parent51702e72de15637653f8cc153ffeb43cdb194827 (diff)
downloaddebug-me-75c8b6b9745ea8e64383e28d3f18b1609be00fa3.tar.gz
add --download mode
Nice, was able to reuse all the protocol stuff from Role.Developer for this. This commit was sponsored by Fernando Jimenez on Patreon.
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index 8fd5c9f..9d30eb3 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -11,6 +11,7 @@ data CmdLine = CmdLine
data Mode
= UserMode UserOpts
| DeveloperMode DeveloperOpts
+ | DownloadMode DownloadOpts
| GraphvizMode GraphvizOpts
| ReplayMode ReplayOpts
| ServerMode ServerOpts
@@ -23,6 +24,10 @@ data DeveloperOpts = DeveloperOpts
{ debugUrl :: String
}
+data DownloadOpts = DownloadOpts
+ { downloadUrl :: String
+ }
+
data GraphvizOpts = GraphvizOpts
{ graphvizLogFile :: FilePath
, graphvizShowHashes :: Bool
@@ -44,6 +49,7 @@ parseMode :: Parser Mode
parseMode = (UserMode <$> parseuser)
<|> (DeveloperMode <$> parsedeveloper)
<|> (ReplayMode <$> parsereplay)
+ <|> (DownloadMode <$> parsedownload)
<|> (GraphvizMode <$> parsegraphviz)
<|> (ServerMode <$> parseserver)
where
@@ -67,6 +73,12 @@ parseMode = (UserMode <$> parseuser)
<> metavar "logfile"
<> help "replay log file"
)
+ parsedownload = DownloadOpts
+ <$> option str
+ ( long "download"
+ <> metavar "logfile"
+ <> help "download log file from server"
+ )
parseserver = ServerOpts
<$> option str
( long "server"