Simplify runghc command line options
Currently there are three ways runghc can pass options to GHC:
- unrecognized options are automatically passed to GHC
- options after a
--
are passed to GHC -
--ghc-args=<arg>
passes arg to GHC
The command line is difficult to comprehend and non-intuitive with all these different ways to pass options to GHC. Other than having multiple ways to do the same thing there are other problems too. For example:
- The meaning of
--
is overloaded, the usual meaning is that everything after it is non option or opaque args. This is difficult to explain and creates confusion. - To pass a filename starting with a dash we need something like
runghc -- -- -prog.hs
. Which is not a usual use case but it needs to be explained in the manual anyway. - It first appears that options after
--
will be passed to GHC including those not starting with a-
but that is not the case. For args not starting with a-
we need to use--ghc-arg=
so there is not much use of the--
anyway other than increased confusion.
I propose to do away with all other mechanisms other than the explicit --ghc-arg=<arg>
method. This will make the documentation and understanding of the command straightforward and intuitive. Though the change will not be backward compatible. If backward compatibility is really needed we will have to use deprecation warnings for the unsupported methods and remove them from the official documentation and wait for some time before we actually remove them.
Trac metadata
Trac field | Value |
---|---|
Version | 8.0.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | None |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |