summaryrefslogtreecommitdiffhomepage
path: root/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-22 12:24:06 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-22 12:24:06 -0400
commit9762ac8da9b938a40423b79966b35be080686620 (patch)
tree63e1744818830ab2c15908bd753c0e74349ec662 /CmdLine.hs
parent1e12f0574214cd68b2d201889ff15e79a5cc0076 (diff)
downloadkeysafe-9762ac8da9b938a40423b79966b35be080686620.tar.gz
--server needs a port
Diffstat (limited to 'CmdLine.hs')
-rw-r--r--CmdLine.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/CmdLine.hs b/CmdLine.hs
index 283e768..c15ca83 100644
--- a/CmdLine.hs
+++ b/CmdLine.hs
@@ -11,6 +11,7 @@ import qualified Gpg
import Options.Applicative
import qualified Data.ByteString.UTF8 as BU8
import System.Directory
+import Network.Wai.Handler.Warp (Port)
data CmdLine = CmdLine
{ mode :: Maybe Mode
@@ -21,7 +22,7 @@ data CmdLine = CmdLine
, customShareParams :: Maybe ShareParams
}
-data Mode = Backup | Restore | UploadQueued | Server | Benchmark
+data Mode = Backup | Restore | UploadQueued | Server Port | Benchmark
deriving (Show)
parse :: Parser CmdLine
@@ -45,8 +46,9 @@ parse = CmdLine
( long "uploadqueued"
<> help "Upload any data to servers that was queued by a previous --backup run."
)
- server = flag' Server
+ server = Server <$> option auto
( long "server"
+ <> metavar "PORT"
<> help "Run as a keysafe server, accepting objects and storing them to ~/.keysafe/objects/local/"
)
benchmark = flag' Benchmark