From 78e35d8a744c180e449ecf50459c210e75ac5aa5 Mon Sep 17 00:00:00 2001 From: Alan Zimmerman Date: Thu, 12 Jan 2017 15:19:17 +0200 Subject: [PATCH] Changes to work with optparse-applicative 0.13.0.0 --- ghc-mod.cabal | 4 ++-- src/GHCMod/Options/Commands.hs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ghc-mod.cabal b/ghc-mod.cabal index 3876662..b1abbc4 100644 --- a/ghc-mod.cabal +++ b/ghc-mod.cabal @@ -201,7 +201,7 @@ Library , extra < 1.6 && >= 1.4 , pipes < 4.4 && >= 4.1 , safe < 0.4 && >= 0.3.9 - , optparse-applicative <0.13.0 && >=0.11.0 + , optparse-applicative <0.14.0 && >=0.13.0 , template-haskell if impl(ghc < 7.8) Build-Depends: convertible < 1.2 && >= 1.1.0.0 @@ -228,7 +228,7 @@ Executable ghc-mod , ghc < 8.2 && >= 7.6 , monad-control < 1.1 && >= 1 , fclabels == 2.0.* - , optparse-applicative >=0.11.0 && <0.13.0 + , optparse-applicative >=0.13.0 && <0.14.0 , ghc-mod Executable ghc-modi diff --git a/src/GHCMod/Options/Commands.hs b/src/GHCMod/Options/Commands.hs index b4bb524..c31ed15 100644 --- a/src/GHCMod/Options/Commands.hs +++ b/src/GHCMod/Options/Commands.hs @@ -18,6 +18,7 @@ module GHCMod.Options.Commands where +import Data.Semigroup import Options.Applicative import Options.Applicative.Types import Options.Applicative.Builder.Internal @@ -289,8 +290,8 @@ hsubparser' :: Mod CommandFields a -> Parser a hsubparser' m = mkParser d g rdr where Mod _ d g = m `mappend` metavar "" - (cmds, subs) = mkCommand m - rdr = CmdReader cmds (fmap add_helper . subs) + (ms, cmds, subs) = mkCommand m + rdr = CmdReader ms cmds (fmap add_helper . subs) add_helper pinfo = pinfo { infoParser = infoParser pinfo <**> helper }