summaryrefslogtreecommitdiff
path: root/ui/terminal
diff options
context:
space:
mode:
Diffstat (limited to 'ui/terminal')
-rw-r--r--ui/terminal/status.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/ui/terminal/status.go b/ui/terminal/status.go
index c8eb382fc..2445c5b2c 100644
--- a/ui/terminal/status.go
+++ b/ui/terminal/status.go
@@ -27,6 +27,7 @@ type statusOutput struct {
format string
start time.Time
+ quiet bool
}
// NewStatusOutput returns a StatusOutput that represents the
@@ -35,12 +36,13 @@ type statusOutput struct {
//
// statusFormat takes nearly all the same options as NINJA_STATUS.
// %c is currently unsupported.
-func NewStatusOutput(w Writer, statusFormat string) status.StatusOutput {
+func NewStatusOutput(w Writer, statusFormat string, quietBuild bool) status.StatusOutput {
return &statusOutput{
writer: w,
format: statusFormat,
start: time.Now(),
+ quiet: quietBuild,
}
}
@@ -76,13 +78,12 @@ func (s *statusOutput) FinishAction(result status.ActionResult, counts status.Co
progress := s.progress(counts) + str
if result.Error != nil {
- hasCommand := ""
- if result.Command != "" {
- hasCommand = "\n"
+ targets := strings.Join(result.Outputs, " ")
+ if s.quiet || result.Command == "" {
+ s.writer.StatusAndMessage(progress, fmt.Sprintf("FAILED: %s\n%s", targets, result.Output))
+ } else {
+ s.writer.StatusAndMessage(progress, fmt.Sprintf("FAILED: %s\n%s\n%s", targets, result.Command, result.Output))
}
-
- s.writer.StatusAndMessage(progress, fmt.Sprintf("FAILED: %s\n%s%s%s",
- strings.Join(result.Outputs, " "), result.Command, hasCommand, result.Output))
} else if result.Output != "" {
s.writer.StatusAndMessage(progress, result.Output)
} else {