Simplified implementation of cert/key parser option
This commit is contained in:
parent
4699479bbb
commit
a068bbdb8c
@ -169,15 +169,11 @@ develOptions = Devel <$> optStr ( long "success-hook" <> short 's' <> metavar "C
|
|||||||
<> help "Disable reverse proxy" )
|
<> help "Disable reverse proxy" )
|
||||||
<*> optStr (long "host" <> metavar "HOST"
|
<*> optStr (long "host" <> metavar "HOST"
|
||||||
<> help "Host interface to bind to; IP address, '*' for all interfaces, '*4' for IP4, '*6' for IP6")
|
<> help "Host interface to bind to; IP address, '*' for all interfaces, '*4' for IP4, '*6' for IP6")
|
||||||
<*> optionPair
|
<*> optional ( (,)
|
||||||
(strOption (long "cert" <> metavar "CERT"
|
<$> strOption (long "cert" <> metavar "CERT"
|
||||||
<> help "Path to TLS certificate file, requires that --key is also defined"))
|
<> help "Path to TLS certificate file, requires that --key is also defined")
|
||||||
(strOption (long "key" <> metavar "KEY"
|
<*> strOption (long "key" <> metavar "KEY"
|
||||||
<> help "Path to TLS key file, requires that --cert is also defined"))
|
<> help "Path to TLS key file, requires that --cert is also defined") )
|
||||||
|
|
||||||
optionPair :: Parser a -> Parser b -> Parser (Maybe (a,b))
|
|
||||||
optionPair pa pb = Just <$> liftA2 (,) pa pb
|
|
||||||
<|> pure Nothing
|
|
||||||
|
|
||||||
extraStackArgs :: Parser [String]
|
extraStackArgs :: Parser [String]
|
||||||
extraStackArgs = many (strOption ( long "extra-stack-arg" <> short 'e' <> metavar "ARG"
|
extraStackArgs = many (strOption ( long "extra-stack-arg" <> short 'e' <> metavar "ARG"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user