Small fix to --config parameter to allow for an argument
+ Added check to test for a valid directory
This commit is contained in:
parent
a84842730e
commit
d8e7cd694d
1 changed files with 14 additions and 2 deletions
16
cli.cpp
16
cli.cpp
|
|
@ -5,6 +5,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "OpenRGB.h"
|
#include "OpenRGB.h"
|
||||||
#include "AutoStart.h"
|
#include "AutoStart.h"
|
||||||
|
#include "filesystem.h"
|
||||||
#include "ProfileManager.h"
|
#include "ProfileManager.h"
|
||||||
#include "ResourceManager.h"
|
#include "ResourceManager.h"
|
||||||
#include "RGBController.h"
|
#include "RGBController.h"
|
||||||
|
|
@ -1022,9 +1023,20 @@ unsigned int cli_pre_detection(int argc, char *argv[])
|
||||||
\*---------------------------------------------------------*/
|
\*---------------------------------------------------------*/
|
||||||
else if(option == "--config")
|
else if(option == "--config")
|
||||||
{
|
{
|
||||||
ResourceManager::get()->SetConfigurationDirectory(argument);
|
cfg_args+= 2;
|
||||||
cfg_args++;
|
|
||||||
arg_index++;
|
arg_index++;
|
||||||
|
|
||||||
|
if(filesystem::is_directory(argument))
|
||||||
|
{
|
||||||
|
ResourceManager::get()->SetConfigurationDirectory(argument);
|
||||||
|
LOG_INFO("Setting config directory to %s",argument.c_str());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_ERROR("'%s' is not a valid directory",argument.c_str());
|
||||||
|
print_help = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------*\
|
/*---------------------------------------------------------*\
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue