on remove-bazel help sign in
ghcide/exe/Arguments.hs
27 lines 816 B history raw
1-- Copyright (c) 2019 The DAML Authors. All rights reserved.
2-- SPDX-License-Identifier: Apache-2.0
4module Arguments(Arguments(..), getArguments) where
6import Options.Applicative
9data Arguments = Arguments
10 {argLSP :: Bool
11 ,argsCwd :: Maybe FilePath
12 ,argFiles :: [FilePath]
13 }
15getArguments :: IO Arguments
16getArguments = execParser opts
17 where
18 opts = info (arguments <**> helper)
19 ( fullDesc
20 <> progDesc "Used as a test bed to check your IDE will work"
21 <> header "ghcide - the core of a Haskell IDE")
23arguments :: Parser Arguments
24arguments = Arguments
25 <$> switch (long "lsp" <> help "Start talking to an LSP server")
26 <*> optional (strOption $ long "cwd" <> metavar "DIR" <> help "Change to this directory")
27 <*> many (argument str (metavar "FILES/DIRS..."))