Fix build with optparse-applicative 0.10. Closes: #761484

This also works with 0.9, and probably 0.8.
This commit is contained in:
Joey Hess 2014-09-14 12:29:44 -04:00
parent 085c113137
commit 70b2160d32
2 changed files with 3 additions and 8 deletions

10
Test.hs
View file

@ -17,9 +17,6 @@ import Test.Tasty.Ingredients.Rerun
import Data.Monoid
import Options.Applicative hiding (command)
#if MIN_VERSION_optparse_applicative(0,8,0)
import qualified Options.Applicative.Types as Opt
#endif
import qualified Data.Map as M
import qualified Text.JSON
@ -115,16 +112,13 @@ main ps = do
exitFailure
)
where
progdesc = "git-annex test"
parseOpts pprefs pinfo args =
#if MIN_VERSION_optparse_applicative(0,8,0)
pure $ case execParserPure pprefs pinfo args of
Opt.Success v -> v
Opt.Failure f -> error $ fst $ Opt.execFailure f progdesc
Opt.CompletionInvoked _ -> error "completion not supported"
handleParseResult $ execParserPure pprefs pinfo args
#else
either (error <=< flip errMessage progdesc) return $
execParserPure pprefs pinfo args
progdesc = "git-annex test"
#endif
ingredients :: [Ingredient]

1
debian/changelog vendored
View file

@ -22,6 +22,7 @@ git-annex (5.20140832) UNRELEASED; urgency=medium
be using a better backend.
* Rather than crashing when there's a problem with the requested bloomfilter
capacity/accuracy, fall back to a reasonable default bloom filter size.
* Fix build with optparse-applicative 0.10. Closes: #761484
-- Joey Hess <joeyh@debian.org> Thu, 04 Sep 2014 16:17:22 -0400