forked from commercialhaskell/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSDistParser.hs
More file actions
40 lines (37 loc) · 1.24 KB
/
SDistParser.hs
File metadata and controls
40 lines (37 loc) · 1.24 KB
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
{-# LANGUAGE NoImplicitPrelude #-}
-- | Functions to parse command line arguments for Stack's @sdist@ and @upload@
-- commands.
module Stack.Options.SDistParser
( sdistOptsParser
) where
import Options.Applicative
( Parser, completer, help, idm, long, metavar, strArgument
, strOption, switch
)
import Options.Applicative.Builder.Extra ( boolFlags, dirCompleter )
import Stack.Prelude
import Stack.SDist ( SDistOpts (..) )
import Stack.Options.HpcReportParser ( pvpBoundsOption )
-- | Parse command line arguments for Stack's @sdist@ and @upload@ commands.
sdistOptsParser :: Parser SDistOpts
sdistOptsParser = SDistOpts
<$> many (strArgument
( metavar "DIR"
<> completer dirCompleter
))
<*> optional pvpBoundsOption
<*> ignoreCheckSwitch
<*> buildPackageOption
<*> optional (strOption
( long "tar-dir"
<> help "If specified, copy all the tar to this directory."
))
where
ignoreCheckSwitch = switch
( long "ignore-check"
<> help "Do not check package for common mistakes."
)
buildPackageOption = boolFlags False
"test-tarball"
"building of the resulting tarball."
idm