forked from commercialhaskell/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUploadParser.hs
More file actions
35 lines (31 loc) · 905 Bytes
/
UploadParser.hs
File metadata and controls
35 lines (31 loc) · 905 Bytes
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
{-# LANGUAGE NoImplicitPrelude #-}
module Stack.Options.UploadParser
( UploadOpts(..)
, UploadVariant(..)
, uploadOptsParser
) where
import Options.Applicative
import Stack.Options.SDistParser (sdistOptsParser)
import Stack.Prelude
import Stack.SDist (SDistOpts(..))
data UploadOpts = UploadOpts
{ uoptsSDistOpts :: SDistOpts
, uoptsUploadVariant :: UploadVariant
-- ^ Says whether to publish the package or upload as a release candidate
}
data UploadVariant
= Publishing
-- ^ Publish the package
| Candidate
-- ^ Create a package candidate
-- | Parser for arguments to `stack upload`
uploadOptsParser :: Parser UploadOpts
uploadOptsParser =
UploadOpts
<$> sdistOptsParser
<*> uploadVariant
where
uploadVariant =
flag Publishing Candidate
(long "candidate" <>
help "Upload as a package candidate")