Files
EZ4Connect/application/commandlineoptions.cpp
2026-07-28 14:09:26 +08:00

20 lines
545 B
C++

#include "commandlineoptions.h"
QString CommandLineOptions::value(const QStringList &arguments, const QString &key)
{
const QString prefix = key + "=";
for (int index = 0; index < arguments.size(); ++index)
{
const QString &argument = arguments.at(index);
if (argument == key)
{
return index + 1 < arguments.size() ? arguments.at(index + 1) : QString();
}
if (argument.startsWith(prefix))
{
return argument.mid(prefix.size());
}
}
return {};
}