@@ -1,12 +1,12 @@
11module Main where
22
33import Control.Monad ( when )
4+import Safe (headNote)
45import System.Exit ( exitSuccess )
56
67import Idris.AbsSyntax
78import Idris.Error
89import Idris.CmdOptions
9−import Idris.Info
1010import Idris.Info.Show
1111import Idris.Package
1212import Idris.Main
@@ -30,14 +30,14 @@ check opts extractOpts action = do
3030 runIO exitSuccess
3131
3232processClientOptions :: [Opt] -> Idris ()
33−processClientOptions opts = check opts getClient $ \fs -> case fs of
34− (c:_) -> do
35− setVerbose False
36− setQuiet True
37− case getPort opts of
38− Just DontListen -> ifail "\"--client\" and \"--port none\" are incompatible"
39− Just (ListenPort port) -> runIO $ runClient (Just port) c
40− Nothing -> runIO $ runClient Nothing c
33+processClientOptions opts = check opts getClient $ \fs -> do
34+ let c = headNote "No --client argument. This indicates a bug. Please report." fs
35+ setVerbose False
36+ setQuiet True
37+ case getPort opts of
38+ Just DontListen -> ifail "\"--client\" and \"--port none\" are incompatible"
39+ Just (ListenPort port) -> runIO $ runClient (Just port) c
40+ Nothing -> runIO $ runClient Nothing c
4141
4242processPackageOptions :: [Opt] -> Idris ()
4343processPackageOptions opts = do