#1312: runghc doesn't respect -main-is
----------------------+-----------------------------------------------------
Reporter: simonmar | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 6.8.3
Component: Compiler | Version: 6.6.1
Severity: minor | Resolution:
Keywords: | Difficulty: Easy (1 hr)
Testcase: | Architecture: Multiple
Os: Unknown |
----------------------+-----------------------------------------------------
Comment (by igloo):
`:main` also always runs main, regardless of any `-main-is` flag,
currently. Also, it parses arguments itself, so we would have to build
strings in such a way that it would parse them correctly. Also, `ghc -e
:main` doesn't seem to work at the moment.
I propose changing `:main`'s behaviour, adding `:run` and adding `:set
arg-style` so that things work like this:
{{{
:main arg1 arg2 -- runs main, with args ["arg1", "arg2"]
:set -main-is foo
:main arg1 arg2 -- runs foo, with args ["arg1", "arg2"]
:run bar arg1 arg2 -- runs bar, with args ["arg1", "arg2"]
:set arg-style haskell -- opposite is :set arg-style shell
:main ["arg1", "arg2"] -- runs foo, with args ["arg1", "arg2"]
}}}
and changing ghc so that
{{{
ghc -e X -e Y
}}}
behaves more like
{{{
X
Y
}}}
in ghci. Any opinions?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1312#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs