summaryrefslogtreecommitdiffstats
path: root/src/sdk/commandlineparser.cpp
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-03-11 18:35:05 +0200
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2020-03-19 06:56:52 +0200
commit8878f49cc00a5dcd0a8acd89cd5c9d8b89505941 (patch)
tree3db628af65c8f88067f8f49dcdedac1375fc1d38 /src/sdk/commandlineparser.cpp
parentea8f8f2d8c9170dcf8c087786125db09c8d18dec (diff)
Refactor naming and usage of CLI commands
- Rename and alter the description of some command line options according to validation results from task QTIFW-1635. The suggested additions are not added in this change. - Remove options "framework-version" and "silentUpdate", these should not be needed anymore. - Combine options "installPackages" and "installDefault" into single "install" command. - Change command line syntax from "binary [options]" to "binary [options] command <arguments>". - Re-order & group known option variables and "--help" printing order based on their topic. - Move CommandLineParser class files under src/libs/installer and add private class for future options extension. Short versions of command line options should be added in a follow-up commit. Task-number: QTIFW-1671 Change-Id: Ie0d393368b5275c8ffa1ab8833885b149af3178e Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/sdk/commandlineparser.cpp')
-rw-r--r--src/sdk/commandlineparser.cpp154
1 files changed, 0 insertions, 154 deletions
diff --git a/src/sdk/commandlineparser.cpp b/src/sdk/commandlineparser.cpp
deleted file mode 100644
index dc9371216..000000000
--- a/src/sdk/commandlineparser.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/**************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Installer Framework.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-**************************************************************************/
-
-#include "commandlineparser.h"
-
-#include "constants.h"
-#include "globals.h"
-
-namespace CommandLineOptions {
-const char KeyValue[] = "Key=Value";
-} // namespace CommandLineOptions
-
-CommandLineParser::CommandLineParser()
-{
- m_parser.addHelpOption();
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::Version),
- QLatin1String("Displays version information.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::FrameworkVersion),
- QLatin1String("Displays the version of the Qt Installer Framework.")));
-
- m_parser.addOption(QCommandLineOption(QStringList()
- << QLatin1String(CommandLineOptions::VerboseShort)
- << QLatin1String(CommandLineOptions::VerboseLong),
- QLatin1String("Verbose mode. Prints out more information.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::Proxy),
- QLatin1String("Use system proxy on Windows and Linux. This option has no effect on macOS.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::NoProxy),
- QLatin1String("Do not use system proxy.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::Script),
- QLatin1String("Execute the script given as argument."), QLatin1String("file")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::CheckUpdates),
- QLatin1String("Check for updates and return an XML description.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::Updater),
- QLatin1String("Start application in updater mode.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::ManagePackages),
- QLatin1String("Start application in package manager mode.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::Uninstaller),
- QLatin1String("Start application in uninstaller mode.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::NoForceInstallation),
- QLatin1String("Allow deselecting components that are marked as forced.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::NoSizeChecking),
- QLatin1String("Disable checking of free space for installation target.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::ShowVirtualComponents),
- QLatin1String("Show virtual components in installer and package manager.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::LoggingRules),
- QLatin1String("Enables logging according to passed rules. "
- "Comma separated logging rules have the following syntax: "
- "loggingCategory=true/false. "
- "Passing empty logging rules enables all logging categories. "
- "The following rules enable a single category: "
- "ifw.*=false,ifw.category=true "
- "The following logging categories are available:\n")
- + QInstaller::loggingCategories().join(QLatin1Char('\n')),
- QLatin1String("rules")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::CreateLocalRepository),
- QLatin1String("Create a local repository inside the installation directory. This option "
- "has no effect on online installers.")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::AddRepository),
- QLatin1String("Add a local or remote repository to the list of user defined repositories."),
- QLatin1String("URI,...")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::AddTmpRepository),
- QLatin1String("Add a local or remote repository to the list of temporary available "
- "repositories."), QLatin1String("URI,...")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::SetTmpRepository),
- QLatin1String("Set a local or remote repository as temporary repository, it is the only "
- "one used during fetch.\nNote: URI must be prefixed with the protocol, i.e. file:///, "
- "https://, http:// or ftp://."), QLatin1String("URI,...")));
-
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::StartServer),
- QLatin1String("Starts the application as headless process waiting for commands to execute."
- " Mode can be DEBUG or PRODUCTION. In DEBUG mode, the option values can be omitted."
- "Note: The server will not shutdown on his own, you need to quit the process by hand."),
- QLatin1String("mode,socketname,key")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::StartClient),
- QString::fromLatin1("Starts the application to debug the client-server communication. If "
- "a value is omitted, the client will use a default instead. Note: The server process is "
- "not started by the client application in that case, you need to start it on your own."),
- QLatin1String("socketname,key")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::InstallCompressedRepository),
- QLatin1String("Installs QBSP or 7z file. The QBSP (Board Support Package) file must be a .7z "
- "file which contains a valid repository."),
- QLatin1String("URI,...")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::SilentUpdate),
- QLatin1String("Updates all packages silently.")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::UpdatePackages),
- QLatin1String("Updates selected packages."), QLatin1String("package,...")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::ListInstalledPackages),
- QLatin1String("Lists installed packages.")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::ListPackages),
- QLatin1String("Lists available packages."), QLatin1String("regexp")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::InstallPackages),
- QLatin1String("Install selected packages"),
- QLatin1String("package,...")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::InstallDefault),
- QLatin1String("Install packages that are checked by default.")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::UninstallSelectedPackages),
- QLatin1String("Uninstall selected packages. Note that all child components will be uninstalled as well"),
- QLatin1String("package,...")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::Platform),
- QLatin1String("Use the specified platform plugin."), QLatin1String("plugin")));
- m_parser.addPositionalArgument(QLatin1String(CommandLineOptions::KeyValue),
- QLatin1String("Key Value pair to be set."));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::TargetDir),
- QLatin1String("Set install directory"),
- QLatin1String("directory")));
- m_parser.addOption(QCommandLineOption(QLatin1String(CommandLineOptions::SquishPort),
- QLatin1String("Give a port where Squish can connect to. If no port is given, default "
- "port 11233 is used. Note: To enable Squish support you first need to build IFW with "
- "SQUISH_PATH parameter where SQUISH_PATH is pointing to your Squish installation folder: "
- "<path_to_qt>/bin/qmake -r SQUISH_PATH=<pat_to_squish>"),
- QLatin1String("port number")));
-}