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
30 lines (28 loc) · 1.18 KB
/
SDistParser.hs
File metadata and controls
30 lines (28 loc) · 1.18 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
{-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.SDistParser where
import Options.Applicative
import Options.Applicative.Builder.Extra
import Stack.Prelude
import Stack.SDist
import Stack.Options.HpcReportParser (pvpBoundsOption)
-- | Parser for arguments to `stack sdist` and `stack upload`
sdistOptsParser :: Bool -- ^ Whether to sign by default `stack upload` does, `stack sdist` doesn't
-> Parser SDistOpts
sdistOptsParser signDefault = SDistOpts <$>
many (strArgument $ metavar "DIR" <> completer dirCompleter) <*>
optional pvpBoundsOption <*>
ignoreCheckSwitch <*>
(if signDefault
then switch (long "no-signature" <> help "Do not sign & upload signatures")
else switch (long "sign" <> help "Sign & upload signatures")) <*>
strOption
(long "sig-server" <> metavar "URL" <> showDefault <>
value "https://sig.commercialhaskell.org" <>
help "URL") <*>
buildPackageOption
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