aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-02-10 18:32:51 +0100
committerDaniel Gröber <dxld@darkboxed.org>2019-02-10 18:32:51 +0100
commit996de72399bdfbe2fa498d4998941c40d189c0bf (patch)
tree13e89abcc90c4b58ec1afa4bfae82c9308e9f85a
parentf2189de2797e391124ead51eada6d57b2929c88f (diff)
helper: Make 'version' comand part of the normal parsing logic
-rw-r--r--src/CabalHelper/Runtime/HelperMain.hs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/CabalHelper/Runtime/HelperMain.hs b/src/CabalHelper/Runtime/HelperMain.hs
index 5c84cd2..d3feea2 100644
--- a/src/CabalHelper/Runtime/HelperMain.hs
+++ b/src/CabalHelper/Runtime/HelperMain.hs
@@ -295,15 +295,11 @@ helper_main args = do
let cmds = collectCmdOptions args'
- if any (["version"] `isPrefixOf`) cmds
- then do
- putStrLn $
- printf "using version %s of the Cabal library" (display cabalVersion)
- exitSuccess
- else return ()
-
flip mapM cmds $$ \x -> do
case x of
+ "version":[] ->
+ return $ Just $ ChResponseVersion ("Cabal", toDataVersion cabalVersion)
+
"package-id":[] ->
return $ Just $ ChResponseVersion $ (,)
(display (packageName gpd))