aboutsummaryrefslogtreecommitdiffstats
path: root/src/app/qbs-setup-toolchains/commandlineparser.h
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-02-12 18:07:34 +0100
committerChristian Kandeler <christian.kandeler@digia.com>2014-02-13 12:05:31 +0100
commit0764d2aff60b2c822c81e5e58b4e56055e316efd (patch)
tree6f5ad4d027666bf8c84a26362806ac22896fffcc /src/app/qbs-setup-toolchains/commandlineparser.h
parent032a1c4b4b37814594fbb01a0452ea5efa09dfcf (diff)
Let detect-toolchains be used like setup-qt.
Namely, let people specify a specific compiler and profile name instead of offering only auto-detection. Also rename to setup-toolchains for even more consistency. Task-number: QBS-496 Change-Id: I8c144d7b4dd26e38652f10c1fff56af4daf3cecb Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/app/qbs-setup-toolchains/commandlineparser.h')
-rw-r--r--src/app/qbs-setup-toolchains/commandlineparser.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/app/qbs-setup-toolchains/commandlineparser.h b/src/app/qbs-setup-toolchains/commandlineparser.h
new file mode 100644
index 000000000..6f6cd4f18
--- /dev/null
+++ b/src/app/qbs-setup-toolchains/commandlineparser.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Build Suite.
+**
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+****************************************************************************/
+#ifndef QBS_SETUPTOOLCHAINS_COMMANDLINEPARSER_H
+#define QBS_SETUPTOOLCHAINS_COMMANDLINEPARSER_H
+
+#include <QStringList>
+
+class CommandLineParser
+{
+public:
+ void parse(const QStringList &commandLine);
+
+ bool helpRequested() const { return m_helpRequested; }
+ bool autoDetectionMode() const { return m_autoDetectionMode; }
+
+ QString compilerPath() const { return m_compilerPath; }
+ QString toolchainType() const { return m_toolchainType; }
+ QString profileName() const { return m_profileName; }
+
+ QString usageString() const;
+
+private:
+ void throwError(const QString &message);
+ void assignOptionArgument(const QString &option, QString &argument);
+ void complainAboutExtraArguments();
+
+ bool m_helpRequested;
+ bool m_autoDetectionMode;
+ QString m_compilerPath;
+ QString m_toolchainType;
+ QString m_profileName;
+ QStringList m_commandLine;
+ QString m_command;
+};
+
+#endif // Include guard