Commit 96c2207f authored by Huw Campbell's avatar Huw Campbell Committed by Daniel Gröber

Better optparse error for unknown commands

parent 8e4cef7f
Pipeline #34378627 failed with stage
in 35 minutes and 36 seconds
......@@ -145,7 +145,7 @@ Library
, hlint < 2.1 && >= 2.0.8
, monad-control < 1.1 && >= 1
, monad-journal < 0.8 && >= 0.4
, optparse-applicative < 0.14 && >= 0.13.0.0
, optparse-applicative < 0.15 && >= 0.14
, pipes < 4.4 && >= 4.1
, safe < 0.4 && >= 0.3.9
, semigroups < 0.19 && >= 0.10.0
......@@ -184,7 +184,7 @@ Executable ghc-mod
, base < 4.11 && >= 4.6.0.1
, fclabels < 2.1 && >= 2.0
, monad-control < 1.1 && >= 1
, optparse-applicative < 0.14 && >= 0.13.0.0
, optparse-applicative < 0.15 && >= 0.14
, semigroups < 0.19 && >= 0.10.0
, split < 0.3 && >= 0.2.2
......
......@@ -63,10 +63,10 @@ helpVersion =
r :: ReadM (a -> a)
r = do
v <- readerAsk
case v of
"help" -> readerAbort ShowHelpText
"version" -> readerAbort $ InfoMsg ghcModVersion
_ -> return id
readerAbort $ case v of
"help" -> ShowHelpText
"version" -> InfoMsg ghcModVersion
_ -> UnexpectedError v (SomeParser argAndCmdSpec)
argAndCmdSpec :: Parser (Options, GhcModCommands)
argAndCmdSpec = (,) <$> globalArgSpec <*> commandsSpec
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment