[GHC] #9916: ghc -e ":foo bar" exit status is inconsistent

#9916: ghc -e ":foo bar" exit status is inconsistent -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: new Priority: low | Milestone: Component: GHCi | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: #7962, #9905 | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Since #7962 `ghc -e EXPR` exits with status code 1 if `EXPR` fails to compile. While it's undocumented, `ghc -e` does also accept anything that's valid input to GHCi, including GHCi commands like `:t`. In this case, the exit code of `ghc -e` is not always 1 when the command apparently failed. For example, all of: {{{ ghc -e ':t' ghc -e ':t +' ghc -e ':t =' ghc -e ':t x' ghc -e ':l nonexistentfile.hs' }}} exit with status code 0. But `ghc -e ':l a'` exits with status code 1, because `a` is not a (possible) module name or a source file. (At the code level, `ghc -e ":foo bar"` currently exits with status code 1 when the function for `:foo` raises an exception, and with status code 0 in all other cases.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9916 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC