Commit b943f8f8 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Add a --search cli argument

Mostly for testing, but it could be useful on other cases
parent 97e03475
......@@ -50,6 +50,7 @@ QCommandLineParser* createParser()
parser->addOption(QCommandLineOption(QStringLiteral("compact"), i18n("Compact Mode (auto/compact/full)."), QStringLiteral("mode"), QStringLiteral("auto")));
parser->addOption(QCommandLineOption(QStringLiteral("local-filename"), i18n("Local package file to install"), QStringLiteral("package")));
parser->addOption(QCommandLineOption(QStringLiteral("listbackends"), i18n("List all the available backends.")));
parser->addOption(QCommandLineOption(QStringLiteral("search"), i18n("Search string."), QStringLiteral("text")));
parser->addOption(QCommandLineOption(QStringLiteral("test"), QStringLiteral("Test file"), QStringLiteral("file.qml")));
parser->addPositionalArgument(QStringLiteral("urls"), i18n("Supports appstream: url scheme"));
DiscoverBackendsFactory::setupCommandLine(parser);
......@@ -71,6 +72,9 @@ void processArgs(QCommandLineParser* parser, DiscoverObject* mainWindow)
if(parser->isSet(QStringLiteral("mode")))
mainWindow->openMode(parser->value(QStringLiteral("mode")));
if(parser->isSet(QStringLiteral("search")))
mainWindow->openSearch(parser->value(QStringLiteral("search")));
if(parser->isSet(QStringLiteral("local-filename")))
mainWindow->openLocalPackage(QUrl::fromUserInput(parser->value(QStringLiteral("local-filename")), {}, QUrl::AssumeLocalFile));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment