blob: 35b774c6a3c908e39f4849a29474fe86cd9e8fbb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
module Coolbal.Options (
Options(..),
BuildOptions(..),
optionParser,
) where
import Options.Applicative
data Options
= Build BuildOptions
| Clean
| Configure
deriving (Show)
data BuildOptions = BuildOptions (Maybe String)
deriving (Show)
optionParser :: ParserInfo Options
optionParser =
info (root <**> helper)
(fullDesc
<> header "coolbal - Faster cabal for common cases"
<> progDesc "Some simple Haskell projects don't need all the complexity of \
\Cabal's re-configuration logic. Coolbal can take an already-built \
\Cabal project and rebuild it as long as you don't change the \
\configuration too much, and as long as you don't use too-special \
\Cabal features. Always check that coolbal gives you the expected \
\result.")
root :: Parser Options
root =
hsubparser (
command "build" (info (Build <$> buildOptions)
(progDesc "Build the project"))
<> command "clean" (info (pure Clean)
(progDesc "Clean coolbal's files for this project"))
<> command "configure" (info (pure Configure)
(progDesc "Initialise coolbal for this project")))
buildOptions :: Parser BuildOptions
buildOptions = BuildOptions <$> optional (argument str (metavar "TARGET"))
|