From d6fbc08d67de808e98e61c80066823803f24cc80 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 17 Sep 2014 13:36:47 -0400 Subject: 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.) --- Test.hs | 13 ++++++++----- git-annex.cabal | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Test.hs b/Test.hs index 9a716e8ff..825c01879 100644 --- a/Test.hs +++ b/Test.hs @@ -113,13 +113,16 @@ main ps = do ) where parseOpts pprefs pinfo args = -#if MIN_VERSION_optparse_applicative(0,8,0) - handleParseResult $ execParserPure pprefs pinfo args +#if MIN_VERSION_optparse_applicative(0,10,0) + case execParserPure pprefs pinfo args of + (Options.Applicative.Failure failure) -> do + let (msg, _exit) = renderFailure failure progdesc + error msg + v -> handleParseResult v #else - either (error <=< flip errMessage progdesc) return $ - execParserPure pprefs pinfo args - progdesc = "git-annex test" + handleParseResult $ execParserPure pprefs pinfo args #endif + progdesc = "git-annex test" ingredients :: [Ingredient] ingredients = diff --git a/git-annex.cabal b/git-annex.cabal index 48c25d945..079da8858 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1,5 +1,5 @@ Name: git-annex -Version: 5.20140915 +Version: 5.20140916 Cabal-Version: >= 1.8 License: GPL-3 Maintainer: Joey Hess @@ -132,7 +132,7 @@ Executable git-annex if flag(TestSuite) 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 if flag(TDFA) -- cgit v1.2.3