summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-04-30 14:58:32 -0400
committerJoey Hess <joeyh@joeyh.name>2017-04-30 14:58:32 -0400
commitb0f8a010254b97548b5a7140cc7137c53e30f8cd (patch)
tree705319640348385f286bb40d0b0160d35a64c09a /CmdLine.hs
parentcf8d59b2fbcc52378f5ae840e2153f444a3283bf (diff)
downloaddebug-me-b0f8a010254b97548b5a7140cc7137c53e30f8cd.tar.gz
server: email logs to user, and option to delete old ones
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index a1eda5c..13cb309 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -1,9 +1,12 @@
module CmdLine where
+import Types
+
import Data.Monoid
import Options.Applicative
import Network.URI
import Network.Wai.Handler.Warp (Port)
+import qualified Data.Text as T
data CmdLine = CmdLine
{ mode :: Mode
@@ -47,6 +50,8 @@ data ReplayOpts = ReplayOpts
data ServerOpts = ServerOpts
{ serverDirectory :: FilePath
, serverPort :: Port
+ , serverEmail :: Maybe EmailAddress
+ , serverDeleteOldLogs :: Bool
}
data ControlOpts = ControlOpts
@@ -106,7 +111,7 @@ parseMode = (UserMode <$> parseuser)
<> help "display a debug-me session non-interactively"
)
parseserver = ServerOpts
- <$> option str
+ <$> strOption
( long "server"
<> metavar "logdir"
<> help "run server, storing logs in the specified directory"
@@ -118,6 +123,15 @@ parseMode = (UserMode <$> parseuser)
<> showDefault
<> help "port for server to listen on"
)
+ <*> optional (T.pack <$> strOption
+ ( long "from-email"
+ <> metavar "address"
+ <> help "email session logs using this from address"
+ ))
+ <*> switch
+ ( long "delete-old-logs"
+ <> help "delete session logs after session is done"
+ )
parsecontrol = ControlOpts
<$> switch
( long "control"