Skip to content
GitLab
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
5596b041
Commit
5596b041
authored
Jan 15, 2015
by
Andrey Mokhov
Browse files
Generalise run and terseRun.
parent
cff887e3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Oracles/Builder.hs
View file @
5596b041
...
...
@@ -95,27 +95,27 @@ with builder = do
-- Run the builder with a given collection of arguments
-- Raises an error if the builder is not uniquely specified in config files
run
::
Builder
->
Args
->
Action
()
run
builder
a
rg
s
=
do
run
::
ShowArgs
a
=>
Builder
->
a
->
Action
()
run
builder
as
=
do
needBuilder
builder
[
exe
]
<-
showArgs
builder
args
'
<-
arg
s
cmd
[
exe
]
args
'
args
<-
showArgs
a
s
cmd
[
exe
]
args
-- Run the builder with a given collection of arguments printing out a
-- terse commentary with only 'interesting' info for the builder.
-- Raises an error if the builder is not uniquely specified in config files
terseRun
::
Builder
->
Args
->
Action
()
terseRun
builder
a
rg
s
=
do
args
'
<-
arg
s
terseRun
::
ShowArgs
a
=>
Builder
->
a
->
Action
()
terseRun
builder
as
=
do
args
<-
showArgs
a
s
putNormal
$
"/--------
\n
| Running "
++
show
builder
++
" with arguments:"
mapM_
(
putNormal
.
(
"| "
++
))
$
interestingInfo
builder
args
'
mapM_
(
putNormal
.
(
"| "
++
))
$
interestingInfo
builder
args
putNormal
"
\\
--------"
quietly
$
run
builder
a
rg
s
quietly
$
run
builder
as
interestingInfo
::
Builder
->
[
String
]
->
[
String
]
interestingInfo
builder
ss
=
case
builder
of
Ar
->
prefixAndSuffix
3
1
ss
Ar
->
prefixAndSuffix
2
1
ss
Ld
->
prefixAndSuffix
4
0
ss
Ghc
_
->
if
head
ss
==
"-M"
then
prefixAndSuffix
1
1
ss
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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