Trigger the display of error and output in sourced commands from the result object's status instead of the presence of text in the error stream

This should be more consistent with the notion of command success/failure and avoids spewing warnings that the user might not care about
There will need to be an option to specify the level of verbosity desired (never show anything, only show failures, errors and warning, everything)

llvm-svn: 170167
This commit is contained in:
Enrico Granata
2012-12-14 00:52:54 +00:00
parent 3b606d6fd5
commit dc3f4f90d1

View File

@@ -1349,13 +1349,14 @@ Driver::MainLoop ()
}
// if the command sourcing generated an error - dump the result object
const size_t error_size = result.GetErrorSize();
if (error_size > 0)
if (result.Succeeded() == false)
{
const size_t output_size = result.GetOutputSize();
if (output_size > 0)
m_io_channel_ap->OutWrite (result.GetOutput(dump_stream_only_if_no_immediate), output_size, NO_ASYNC);
m_io_channel_ap->OutWrite (result.GetError(dump_stream_only_if_no_immediate), error_size, NO_ASYNC);
const size_t error_size = result.GetErrorSize();
if (error_size > 0)
m_io_channel_ap->OutWrite (result.GetError(dump_stream_only_if_no_immediate), error_size, NO_ASYNC);
}
result.Clear();