optparse-applicative 0.11
This commit is contained in:
parent
dfd059165d
commit
e1a239a749
@ -62,6 +62,8 @@ configLines = mapMaybe (mkLine . takeWhile (/='#')) . lines
|
||||
-- the map contains the paths with the value that's passed into the reader if the
|
||||
-- command line parser gives no result
|
||||
injectDefaultP :: M.Map [String] String -> [String] -> Parser a -> Parser a
|
||||
injectDefaultP _ _ = id
|
||||
{- FIXME Disabled due to changes in optparse-applicative 0.11
|
||||
injectDefaultP _env _path n@(NilP{}) = n
|
||||
injectDefaultP env path p@(OptP o)
|
||||
| (Option (CmdReader cmds f) props) <- o =
|
||||
@ -84,7 +86,7 @@ injectDefaultP env path (MultP p1 p2) =
|
||||
injectDefaultP env path (AltP p1 p2) =
|
||||
AltP (injectDefaultP env path p1) (injectDefaultP env path p2)
|
||||
injectDefaultP _env _path b@(BindP {}) = b
|
||||
|
||||
-}
|
||||
|
||||
getEnvValue :: M.Map [String] String -> [String] -> OptName -> Maybe String
|
||||
getEnvValue env path (OptLong l) = M.lookup (path ++ [normalizeName l]) env
|
||||
|
||||
@ -15,8 +15,6 @@ import Options (injectDefaults)
|
||||
import qualified Paths_yesod_bin
|
||||
import Scaffolding.Scaffolder
|
||||
|
||||
import Options.Applicative.Types (ReadM (ReadM))
|
||||
|
||||
import HsFile (mkHsFile)
|
||||
#ifndef WINDOWS
|
||||
import Build (touch)
|
||||
@ -184,10 +182,7 @@ extraCabalArgs = many (strOption ( long "extra-cabal-arg" <> short 'e' <> metava
|
||||
|
||||
-- | Optional @String@ argument
|
||||
optStr :: Mod OptionFields (Maybe String) -> Parser (Maybe String)
|
||||
optStr m =
|
||||
nullOption (success . str) $ value Nothing <> m
|
||||
where
|
||||
success = ReadM . Right
|
||||
optStr m = option (Just <$> str) $ value Nothing <> m
|
||||
|
||||
-- | Like @rawSystem@, but exits if it receives a non-success result.
|
||||
rawSystem' :: String -> [String] -> IO ()
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: yesod-bin
|
||||
version: 1.4.0
|
||||
version: 1.4.0.1
|
||||
license: MIT
|
||||
license-file: LICENSE
|
||||
author: Michael Snoyman <michael@snoyman.com>
|
||||
@ -70,7 +70,7 @@ executable yesod
|
||||
, system-fileio >= 0.3 && < 0.4
|
||||
, unordered-containers
|
||||
, yaml >= 0.8 && < 0.9
|
||||
, optparse-applicative >= 0.10
|
||||
, optparse-applicative >= 0.11
|
||||
, fsnotify >= 0.0 && < 0.2
|
||||
, split >= 0.2 && < 0.3
|
||||
, file-embed
|
||||
|
||||
Loading…
Reference in New Issue
Block a user