Add new CLI option, separate auto-detect and auto-connect
This commit is contained in:
parent
30c595c6d6
commit
e1faa783b6
2 changed files with 24 additions and 5 deletions
16
main.cpp
16
main.cpp
|
|
@ -37,6 +37,7 @@ enum
|
|||
RET_FLAG_NO_DETECT = 16,
|
||||
RET_FLAG_CLI_POST_DETECTION = 32,
|
||||
RET_FLAG_START_SERVER = 64,
|
||||
RET_FLAG_NO_AUTO_CONNECT = 128,
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
|
|
@ -173,15 +174,13 @@ int main(int argc, char* argv[])
|
|||
| Perform local connection and/or hardware detection if not |
|
||||
| disabled from CLI |
|
||||
\*---------------------------------------------------------*/
|
||||
if(!(ret_flags & RET_FLAG_NO_DETECT))
|
||||
if(!(ret_flags & RET_FLAG_NO_AUTO_CONNECT))
|
||||
{
|
||||
printf("Attempting to connect to local OpenRGB server.\r\n");
|
||||
|
||||
if(!AttemptLocalConnection())
|
||||
{
|
||||
printf("Local OpenRGB server unavailable, running standalone.\r\n");
|
||||
|
||||
ResourceManager::get()->DetectDevices();
|
||||
printf("Local OpenRGB server unavailable.\r\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -191,6 +190,15 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Perform hardware detection if not disabled from CLI |
|
||||
\*---------------------------------------------------------*/
|
||||
if(!(ret_flags & RET_FLAG_NO_DETECT))
|
||||
{
|
||||
printf("Running standalone.\r\n");
|
||||
ResourceManager::get()->DetectDevices();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Start the server if requested from CLI (this must be done |
|
||||
| after attempting local connection!) |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue