forked from commercialhaskell/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSig.hs
More file actions
65 lines (55 loc) · 1.63 KB
/
Copy pathSig.hs
File metadata and controls
65 lines (55 loc) · 1.63 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
{-|
Module : Stack.Sig
Description : GPG Signatures for Stack
Copyright : (c) FPComplete.com, 2015
License : BSD3
Maintainer : Tim Dysinger <tim@fpcomplete.com>
Stability : experimental
Portability : POSIX
-}
module Stack.Sig
( module Sig
, sigCmdName
, sigSignCmdName
, sigSignHackageCmdName
, sigSignHackageOpts
, sigSignSdistCmdName
, sigSignSdistOpts
)
where
import Options.Applicative
import Stack.Sig.GPG as Sig
import Stack.Sig.Sign as Sig
-- | The command name for dealing with signatures.
sigCmdName :: String
sigCmdName = "sig"
-- | The command name for signing packages.
sigSignCmdName :: String
sigSignCmdName = "sign"
-- | The command name for signing an sdist package file.
sigSignSdistCmdName :: String
sigSignSdistCmdName = "sdist"
-- | The command name for signing all your packages from hackage.org.
sigSignHackageCmdName :: String
sigSignHackageCmdName = "hackage"
-- | The URL of the running signature service to use (sig-service)
url :: Parser String
url = strOption
(long "url" <>
short 'u' <>
metavar "URL" <>
showDefault <>
value "https://sig.commercialhaskell.org")
-- | Signature sign (sdist) options
sigSignSdistOpts :: Parser (String, String)
sigSignSdistOpts = helper <*>
((,) <$> url <*>
argument str (metavar "PATH"))
-- | Signature sign (hackage) options
sigSignHackageOpts :: Parser (String, String)
sigSignHackageOpts = helper <*>
((,) <$> url <*>
argument str (metavar "USER"))