diff --git a/yesod-bin/Options.hs b/yesod-bin/Options.hs index 735702fd..4286f1e2 100644 --- a/yesod-bin/Options.hs +++ b/yesod-bin/Options.hs @@ -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 diff --git a/yesod-bin/main.hs b/yesod-bin/main.hs index 80dd136c..9a7c948f 100755 --- a/yesod-bin/main.hs +++ b/yesod-bin/main.hs @@ -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 () diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index aa9e4657..83be8049 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -1,5 +1,5 @@ name: yesod-bin -version: 1.4.0 +version: 1.4.0.1 license: MIT license-file: LICENSE author: Michael Snoyman @@ -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