From 996de72399bdfbe2fa498d4998941c40d189c0bf Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 10 Feb 2019 18:32:51 +0100 Subject: helper: Make 'version' comand part of the normal parsing logic --- src/CabalHelper/Runtime/HelperMain.hs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') 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)) -- cgit v1.2.3