Fixed GUI not starting when configuration flags are used

This commit is contained in:
jath03 2021-01-07 22:39:29 -08:00
parent b1b260d7cf
commit e4ec0fa46b
2 changed files with 11 additions and 6 deletions

11
cli.cpp
View file

@ -936,6 +936,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
| to detecting devices and/or starting clients |
\*---------------------------------------------------------*/
int arg_index = 1;
unsigned int cfg_args = 0;
unsigned int ret_flags = 0;
unsigned short server_port = OPENRGB_SDK_PORT;
bool server_start = false;
@ -960,6 +961,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
if(option == "--localconfig")
{
ResourceManager::get()->SetConfigurationDirectory("./");
cfg_args++;
}
/*---------------------------------------------------------*\
@ -968,6 +970,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
else if(option == "--config")
{
ResourceManager::get()->SetConfigurationDirectory(argument);
cfg_args++;
arg_index++;
}
@ -977,6 +980,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
else if(option == "--nodetect")
{
ret_flags |= RET_FLAG_NO_DETECT;
cfg_args++;
}
/*---------------------------------------------------------*\
@ -1066,7 +1070,7 @@ unsigned int cli_pre_detection(int argc, char *argv[])
print_help = true;
break;
}
cfg_args++;
arg_index++;
}
@ -1135,6 +1139,11 @@ unsigned int cli_pre_detection(int argc, char *argv[])
ret_flags |= RET_FLAG_START_SERVER;
}
if((argc - cfg_args) <= 1)
{
ret_flags |= RET_FLAG_START_GUI;
}
return(ret_flags);
}