fix: combine errors if --launch is missing

This commit is contained in:
Sefa Eyeoglu 2022-02-17 15:29:09 +01:00
parent 037b0d7190
commit 6b4469c6cc
No known key found for this signature in database
GPG Key ID: C10411294912A422

View File

@ -292,18 +292,10 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
m_liveCheck = args["alive"].toBool(); m_liveCheck = args["alive"].toBool();
m_zipToImport = args["import"].toUrl(); m_zipToImport = args["import"].toUrl();
// error if --launch is missing with --server // error if --launch is missing with --server or --profile
if(m_instanceIdToLaunch.isEmpty() && !m_serverToJoin.isEmpty()) if((!m_serverToJoin.isEmpty() || !m_profileToUse.isEmpty()) && m_instanceIdToLaunch.isEmpty())
{ {
std::cerr << "--server can only be used in combination with --launch!" << std::endl; std::cerr << "--server and --profile can only be used in combination with --launch!" << std::endl;
m_status = Application::Failed;
return;
}
// error if --launch is missing with --account
if(m_instanceIdToLaunch.isEmpty() && !m_profileToUse.isEmpty())
{
std::cerr << "--account can only be used in combination with --launch!" << std::endl;
m_status = Application::Failed; m_status = Application::Failed;
return; return;
} }