Skip to content
This repository was archived by the owner on Aug 23, 2018. It is now read-only.

Commit efb9598

Browse files
committed
Update for new dependency versions
Allow newer http-client, update for latest optparse-applicative
1 parent 85df1c8 commit efb9598

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

elm-package.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Library
6666
elm-compiler >= 0.14 && < 0.15,
6767
filepath >= 1 && < 2.0,
6868
HTTP >= 4000.2.5 && < 4000.3,
69-
http-client >= 0.3 && < 0.4,
69+
http-client >= 0.3 && < 0.5,
7070
http-client-tls >= 0.2 && < 0.3,
7171
http-types >= 0.7 && < 0.9,
7272
mtl >= 2 && < 3,
@@ -128,12 +128,12 @@ Executable elm-package
128128
elm-compiler >= 0.14 && < 0.15,
129129
filepath >= 1 && < 2.0,
130130
HTTP >= 4000.2.5 && < 4000.3,
131-
http-client >= 0.3 && < 0.4,
131+
http-client >= 0.3 && < 0.5,
132132
http-client-tls >= 0.2 && < 0.3,
133133
http-types >= 0.7 && < 0.9,
134134
mtl >= 2 && < 3,
135135
network >= 2.4 && < 2.7,
136-
optparse-applicative >= 0.8.1 && < 0.11,
136+
optparse-applicative >= 0.11 && < 0.12,
137137
pretty,
138138
process >= 1 && < 2,
139139
text,

src/CommandLine/Arguments.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
module CommandLine.Arguments (parse) where
22

33
import Control.Applicative (pure, optional, (<$>), (<*>), (<|>))
4+
import Control.Monad (mzero)
45
import Control.Monad.Error (throwError)
6+
import Control.Monad.Reader.Class (ask)
57
import Data.Monoid ((<>), mconcat, mempty)
68
import Data.Version (showVersion)
79
import qualified Options.Applicative as Opt
@@ -160,17 +162,22 @@ installInfo =
160162

161163
-- ARGUMENT PARSERS
162164

165+
mkParser :: (String -> Maybe a) -> Opt.ReadM a
166+
mkParser p =
167+
do s <- Opt.str
168+
maybe mzero return . p $ s
169+
163170
package :: Opt.Parser N.Name
164171
package =
165-
Opt.argument N.fromString $
172+
Opt.argument (mkParser N.fromString) $
166173
mconcat
167174
[ Opt.metavar "PACKAGE"
168175
, Opt.help "A specific package name (e.g. evancz/automaton)"
169176
]
170177

171178
version :: Opt.Parser V.Version
172179
version =
173-
Opt.argument V.fromString $
180+
Opt.argument (mkParser V.fromString) $
174181
mconcat
175182
[ Opt.metavar "VERSION"
176183
, Opt.help "Specific version of a package (e.g. 1.2.0)"

0 commit comments

Comments
 (0)