fix display of git-annex test command name in usage

This needs optparse-applicative 0.10. Dropped support for 0.9 and older,
but kept 0.9.1 working since autobuilders and debian testing still use it.
(The display is not perfect with 0.9.1.)
This commit is contained in:
Joey Hess 2014-09-17 13:36:47 -04:00
parent 692928128a
commit 90d172365d
2 changed files with 10 additions and 7 deletions

13
Test.hs
View file

@ -113,13 +113,16 @@ main ps = do
) )
where where
parseOpts pprefs pinfo args = parseOpts pprefs pinfo args =
#if MIN_VERSION_optparse_applicative(0,8,0) #if MIN_VERSION_optparse_applicative(0,10,0)
handleParseResult $ execParserPure pprefs pinfo args case execParserPure pprefs pinfo args of
(Options.Applicative.Failure failure) -> do
let (msg, _exit) = renderFailure failure progdesc
error msg
v -> handleParseResult v
#else #else
either (error <=< flip errMessage progdesc) return $ handleParseResult $ execParserPure pprefs pinfo args
execParserPure pprefs pinfo args
progdesc = "git-annex test"
#endif #endif
progdesc = "git-annex test"
ingredients :: [Ingredient] ingredients :: [Ingredient]
ingredients = ingredients =

View file

@ -1,5 +1,5 @@
Name: git-annex Name: git-annex
Version: 5.20140915 Version: 5.20140916
Cabal-Version: >= 1.8 Cabal-Version: >= 1.8
License: GPL-3 License: GPL-3
Maintainer: Joey Hess <joey@kitenet.net> Maintainer: Joey Hess <joey@kitenet.net>
@ -132,7 +132,7 @@ Executable git-annex
if flag(TestSuite) if flag(TestSuite)
Build-Depends: tasty (>= 0.7), tasty-hunit, tasty-quickcheck, tasty-rerun, Build-Depends: tasty (>= 0.7), tasty-hunit, tasty-quickcheck, tasty-rerun,
optparse-applicative, crypto-api optparse-applicative (>= 0.9.1), crypto-api
CPP-Options: -DWITH_TESTSUITE CPP-Options: -DWITH_TESTSUITE
if flag(TDFA) if flag(TDFA)