diff options
author | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-11-10 20:04:20 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-11-15 22:44:18 +0000 |
commit | cff05b398cb767af7fddae6a617f26f998c7a781 (patch) | |
tree | 5ea2b2328997524b1891bd383dfa39f5aeb0582f /qmake/library/qmakebuiltins.cpp | |
parent | 712a041eb84f3b0377679f84e78173387480159d (diff) |
qmake: add "undecorated" mode to $$prompt()
the normal mode forces the prompt into a pattern which may be
undesirable.
Change-Id: I01689c7a6573415801862348b32bafc6a609ed4a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'qmake/library/qmakebuiltins.cpp')
-rw-r--r-- | qmake/library/qmakebuiltins.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 6fe3ba1605..b8df43c5fb 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1091,16 +1091,22 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand( break; #ifdef PROEVALUATOR_FULL case E_PROMPT: { - if (args.count() != 1) { - evalError(fL1S("prompt(question) requires one argument.")); + if (args.count() != 1 && args.count() != 2) { + evalError(fL1S("prompt(question, [decorate=true]) requires one or two arguments.")); // } else if (currentFileName() == QLatin1String("-")) { // evalError(fL1S("prompt(question) cannot be used when '-o -' is used")); } else { QString msg = m_option->expandEnvVars(args.at(0).toQString(m_tmp1)); - if (!msg.endsWith(QLatin1Char('?'))) - msg += QLatin1Char('?'); - fprintf(stderr, "Project PROMPT: %s ", qPrintable(msg)); - + bool decorate = true; + if (args.count() == 2) + decorate = isTrue(args.at(1)); + if (decorate) { + if (!msg.endsWith(QLatin1Char('?'))) + msg += QLatin1Char('?'); + fprintf(stderr, "Project PROMPT: %s ", qPrintable(msg)); + } else { + fputs(qPrintable(msg), stderr); + } QFile qfile; if (qfile.open(stdin, QIODevice::ReadOnly)) { QTextStream t(&qfile); |