Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
d4f77b05
Commit
d4f77b05
authored
Jun 22, 2007
by
Simon Marlow
Browse files
ignore all but the last --template option
parent
4bc7e718
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/hsc2hs/Main.hs
View file @
d4f77b05
...
...
@@ -133,7 +133,7 @@ main = do
-- to find one by looking near the executable. This only
-- works on Win32 or Hugs (getExecDir). On Unix, there's a wrapper
-- script which specifies an explicit template flag.
flags_w_tpl
<-
if
any
template_flag
flags
then
flags_w_tpl
0
<-
if
any
template_flag
flags
then
return
flags
else
do
mb_path
<-
getExecDir
"/bin/hsc2hs.exe"
...
...
@@ -147,6 +147,12 @@ main = do
then
return
((
Template
templ
)
:
)
else
return
id
return
(
add_opt
flags
)
-- take only the last --template flag on the cmd line
let
(
before
,
tpl
:
after
)
=
break
template_flag
(
reverse
flags_w_tpl0
)
flags_w_tpl
=
reverse
(
before
++
tpl
:
filter
(
not
.
template_flag
)
after
)
case
(
files
,
errs
)
of
(
_
,
_
)
|
any
isHelp
flags_w_tpl
->
bye
(
usageInfo
header
options
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment