mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
allow servatrice to exit early based on commandline options (#4504)
This commit is contained in:
parent
07e6aadbbe
commit
a9f2fc427b
4 changed files with 17 additions and 9 deletions
|
|
@ -30,6 +30,7 @@
|
|||
#include <QCommandLineParser>
|
||||
#include <QCoreApplication>
|
||||
#include <QDateTime>
|
||||
#include <QFile>
|
||||
#include <QMetaType>
|
||||
#include <QTextCodec>
|
||||
#include <QtGlobal>
|
||||
|
|
@ -140,7 +141,12 @@ int main(int argc, char *argv[])
|
|||
|
||||
qRegisterMetaType<QList<int>>("QList<int>");
|
||||
|
||||
configPath = SettingsCache::guessConfigurationPath(configPath);
|
||||
if (configPath.isEmpty()) {
|
||||
configPath = SettingsCache::guessConfigurationPath();
|
||||
} else if (!QFile::exists(configPath)) {
|
||||
qCritical() << "Could not find configuration file at" << configPath;
|
||||
return 1;
|
||||
}
|
||||
qWarning() << "Using configuration file: " << configPath;
|
||||
settingsCache = new SettingsCache(configPath);
|
||||
|
||||
|
|
@ -167,10 +173,15 @@ int main(int argc, char *argv[])
|
|||
|
||||
PasswordHasher::initialize();
|
||||
|
||||
if (testRandom)
|
||||
if (testRandom) {
|
||||
testRNG();
|
||||
if (testHashFunction)
|
||||
}
|
||||
if (testHashFunction) {
|
||||
testHash();
|
||||
}
|
||||
if (testRandom || testHashFunction) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
smtpClient = new SmtpClient();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue