Skip to content

Command line flag "exclude-module" not recognized

The exclude-module flag used with ghc -M does not work as advertised. The deprecated syntax works correctly, but the new syntax is parsed incorrectly.

module Foo where
import Bar -- Bar.hs does not exist

-- On the command line:
$ ghc -M Foo.hs
Foo.hs:4:7:
    Could not find module `Bar':
      Use -v to see a list of the files searched for.

$ ghc -M Foo.hs -optdep --exclude-module=Bar
on the commandline:
    Warning: -optdep--exclude-module=Bar is deprecated: Use -exclude-module instead

$ ghc -M Foo.hs -exclude-module=Bar
ghc: cannot use `-M' with `-e'

The command line parsing was apparently changed to resolve #1248 (closed).

Trac metadata
Trac field Value
Version 6.10.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Driver
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information