Revive and hook up the option.

This commit is contained in:
Elliot Glaysher 2019-10-17 17:02:33 -07:00
parent 9ec9426b8a
commit 73dae3e805
2 changed files with 7 additions and 0 deletions

View File

@ -23,6 +23,7 @@ data Opts = Opts
, oTrace :: Bool , oTrace :: Bool
, oCollectFx :: Bool , oCollectFx :: Bool
, oLocalhost :: Bool , oLocalhost :: Bool
, oOffline :: Bool
} }
deriving (Show) deriving (Show)
@ -243,6 +244,11 @@ opts = do
<> help "Write effects to disk for debugging" <> help "Write effects to disk for debugging"
<> hidden <> hidden
oOffline <- switch $ short 'O'
<> long "offline"
<> help "Run without any networking"
<> hidden
pure (Opts{..}) pure (Opts{..})
newShip :: Parser Cmd newShip :: Parser Cmd

View File

@ -128,6 +128,7 @@ toPierConfig pierPath CLI.Opts{..} = PierConfig
{ pcPierPath = pierPath { pcPierPath = pierPath
, pcDryRun = oDryRun , pcDryRun = oDryRun
, pcNetworking = if oDryRun then NetworkNone , pcNetworking = if oDryRun then NetworkNone
else if oOffline then NetworkNone
else if oLocalhost then NetworkLocalhost else if oLocalhost then NetworkLocalhost
else NetworkNormal else NetworkNormal
, pcAmesPort = oAmesPort , pcAmesPort = oAmesPort