aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/qbs/parser/commandlineoption.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/qbs/parser/commandlineoption.cpp')
-rw-r--r--src/app/qbs/parser/commandlineoption.cpp44
1 files changed, 34 insertions, 10 deletions
diff --git a/src/app/qbs/parser/commandlineoption.cpp b/src/app/qbs/parser/commandlineoption.cpp
index a09f36c2c..7572b4e66 100644
--- a/src/app/qbs/parser/commandlineoption.cpp
+++ b/src/app/qbs/parser/commandlineoption.cpp
@@ -334,7 +334,7 @@ void StringListOption::doParse(const QString &representation, QStringList &input
throw ErrorInfo(Tr::tr("Invalid use of option '%1': Argument list must not be empty.\n"
"Usage: %2").arg(representation, description(command())));
}
- for (const QString &element : qAsConst(m_arguments)) {
+ for (const QString &element : std::as_const(m_arguments)) {
if (element.isEmpty()) {
throw ErrorInfo(Tr::tr("Invalid use of option '%1': Argument list must not contain "
"empty elements.\nUsage: %2")
@@ -663,27 +663,51 @@ void CommandEchoModeOption::doParse(const QString &representation, QStringList &
m_echoMode = commandEchoModeFromName(mode);
}
-QString WaitLockOption::description(CommandType command) const
+QString DeprecationWarningsOption::description(CommandType command) const
{
Q_UNUSED(command);
- return Tr::tr("%1\n\tWait indefinitely for other processes to release the build graph lock.\n")
- .arg(longRepresentation());
+ return Tr::tr("%1 <mode>\n"
+ "\tWhat to do when encountering deprecated items or properties.\n"
+ "\tPossible values are '%2'.\n"
+ "\tThe default is '%3'.\n")
+ .arg(longRepresentation(),
+ allDeprecationWarningModeStrings().join(QLatin1String("', '")),
+ deprecationWarningModeName(defaultDeprecationWarningMode()));
}
-QString WaitLockOption::longRepresentation() const
+QString DeprecationWarningsOption::longRepresentation() const
{
- return QStringLiteral("--wait-lock");
+ return QStringLiteral("--deprecation-warnings");
}
-QString DisableFallbackProviderOption::description(CommandType) const
+void DeprecationWarningsOption::doParse(const QString &representation, QStringList &input)
{
- return Tr::tr("%1\n\tDo not fall back to pkg-config if a dependency is not found.\n")
+ const QString mode = getArgument(representation, input);
+ if (mode.isEmpty()) {
+ throw ErrorInfo(Tr::tr("Invalid use of option '%1': No deprecation warning mode given.\n"
+ "Usage: %2")
+ .arg(representation, description(command())));
+ }
+
+ if (!allDeprecationWarningModeStrings().contains(mode)) {
+ throw ErrorInfo(Tr::tr("Invalid use of option '%1': "
+ "Invalid deprecation warning mode '%2' given.\nUsage: %3")
+ .arg(representation, mode, description(command())));
+ }
+
+ m_mode = deprecationWarningModeFromName(mode);
+}
+
+QString WaitLockOption::description(CommandType command) const
+{
+ Q_UNUSED(command);
+ return Tr::tr("%1\n\tWait indefinitely for other processes to release the build graph lock.\n")
.arg(longRepresentation());
}
-QString DisableFallbackProviderOption::longRepresentation() const
+QString WaitLockOption::longRepresentation() const
{
- return QStringLiteral("--no-fallback-module-provider");
+ return QStringLiteral("--wait-lock");
}
QString RunEnvConfigOption::description(CommandType command) const