aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/abstractcommandexecutor.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2014-11-05 16:50:37 +0100
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2014-11-07 11:28:35 +0100
commitbd3764d42ed06769ce854f974c6e448ea3263e87 (patch)
treeee0dda2d66a33f58ca912ef7c89922c444622500 /src/lib/corelib/buildgraph/abstractcommandexecutor.cpp
parent842ae64080f33366715c390a5f3b338ea8dd5ff2 (diff)
add option to show command lines in build output
With "qbs build --show-command-lines" one can suppress command descriptions and show actual command lines instead. Change-Id: I98328254bad7fb85036abb0525c5ad7e734110c7 Task-number: QBS-615 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/lib/corelib/buildgraph/abstractcommandexecutor.cpp')
-rw-r--r--src/lib/corelib/buildgraph/abstractcommandexecutor.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/lib/corelib/buildgraph/abstractcommandexecutor.cpp b/src/lib/corelib/buildgraph/abstractcommandexecutor.cpp
index 3549d09c4..3560d20f0 100644
--- a/src/lib/corelib/buildgraph/abstractcommandexecutor.cpp
+++ b/src/lib/corelib/buildgraph/abstractcommandexecutor.cpp
@@ -52,16 +52,23 @@ void AbstractCommandExecutor::start(Transformer *transformer, const AbstractComm
{
m_transformer = transformer;
m_command = cmd;
- if (!m_command->isSilent()) {
- if (m_command->description().isEmpty()) {
- m_logger.printWarning(ErrorInfo(Tr::tr("Command is not marked silent, but has no "
- "description."), m_command->codeLocation()));
- } else {
- emit reportCommandDescription(m_command->highlight(), m_command->description());
- }
- }
+ doReportCommandDescription();
doStart();
}
+void AbstractCommandExecutor::doReportCommandDescription()
+{
+ if (m_command->isSilent())
+ return;
+
+ if (m_command->description().isEmpty()) {
+ m_logger.printWarning(
+ ErrorInfo(Tr::tr("Command is not marked silent, but has no description."),
+ m_command->codeLocation()));
+ } else {
+ emit reportCommandDescription(m_command->highlight(), m_command->description());
+ }
+}
+
} // namespace Internal
} // namespace qbs