@@ -72,12 +72,13 @@ data Options = Options
72 { optionsDirectory :: Maybe FilePath
72 { optionsDirectory :: Maybe FilePath
73 , optionsOutputPath :: FilePath
73 , optionsOutputPath :: FilePath
74 , optionsPort :: PortID
74 , optionsPort :: PortID
75+ , optionsNoWatch :: Bool
75 , optionsDebug :: Bool
76 , optionsDebug :: Bool
78main :: IO ()
79main :: IO ()
80− Options dir outputPath port debug <- execParser opts
81+ Options dir outputPath port noWatch debug <- execParser opts
81 maybe (pure ()) setCurrentDirectory dir
82 maybe (pure ()) setCurrentDirectory dir
82 serverState <- newTVarIO emptyPscIdeState
83 serverState <- newTVarIO emptyPscIdeState
83 cwd <- getCurrentDirectory
84 cwd <- getCurrentDirectory
@@ -88,31 +89,23 @@ main = do
88 (do putStrLn ("Your output directory didn't exist. I'll create it at: " <> fullOutputPath)
89 (do putStrLn ("Your output directory didn't exist. I'll create it at: " <> fullOutputPath)
89 createDirectory fullOutputPath
90 createDirectory fullOutputPath
90 putStrLn "This usually means you didn't compile your project yet."
91 putStrLn "This usually means you didn't compile your project yet."
91− putStrLn "psc-ide needs you to compile your project (for example by running pulp build)"
92+ putStrLn "psc-ide needs you to compile your project (for example by running pulp build)")
94− _ <- forkFinally (watcher serverState fullOutputPath) print
95+ void (forkFinally (watcher serverState fullOutputPath) print)
99− , confOutputPath = outputPath
97+ let conf = Configuration {confDebug = debug, confOutputPath = outputPath}
104− envStateVar = serverState
98+ env = PscIdeEnvironment {envStateVar = serverState, envConfiguration = conf}
105− , envConfiguration = conf
107 startServer port env
99 startServer port env
110− Options <$>
102+ Options
111− optional (strOption (long "directory" <> short 'd')) <*>
103+ <$> optional (strOption (long "directory" <> short 'd'))
112− strOption (long "output-directory" <> value "output/") <*>
104+ <*> strOption (long "output-directory" <> value "output/")
113− (PortNumber . fromIntegral <$>
105+ <*> (PortNumber . fromIntegral <$>
114− option auto (long "port" <> short 'p' <> value (4242 :: Integer))) <*>
106+ option auto (long "port" <> short 'p' <> value (4242 :: Integer)))
107+ <*> switch (long "no-watch")
115− switch (long "debug")
108+ <*> switch (long "debug")
116 opts = info (version <*> helper <*> parser) mempty
109 opts = info (version <*> helper <*> parser) mempty
117 version = abortOption
110 version = abortOption
118 (InfoMsg (showVersion Paths.version))
111 (InfoMsg (showVersion Paths.version))