Allow Tools.Configger to take -inifile as argument

bullet-2.82
Diva Canto 2014-05-07 16:59:11 -07:00
parent 13b2ac1425
commit 3db9b847bf
2 changed files with 9 additions and 8 deletions

View File

@ -64,14 +64,14 @@ namespace OpenSim.Tools.Configger
/// <param name="configSettings"></param>
/// <param name="networkInfo"></param>
/// <returns>A configuration that gets passed to modules</returns>
public IConfigSource LoadConfigSettings()
public IConfigSource LoadConfigSettings(IConfig startupConfig)
{
bool iniFileExists = false;
List<string> sources = new List<string>();
string iniFileName = "OpenSim.ini";
string iniFilePath = Path.Combine(".", iniFileName);
string iniFileName = startupConfig.GetString("inifile", Path.Combine(".", "OpenSim.ini"));
Console.WriteLine("---> " + iniFileName + " <---");
if (IsUri(iniFileName))
{
@ -80,10 +80,10 @@ namespace OpenSim.Tools.Configger
}
else
{
if (File.Exists(iniFilePath))
if (File.Exists(iniFileName))
{
if (!sources.Contains(iniFilePath))
sources.Add(iniFilePath);
if (!sources.Contains(iniFileName))
sources.Add(iniFileName);
}
}

View File

@ -35,15 +35,16 @@ namespace OpenSim.Tools.Configger
public static int Main(string[] args)
{
ArgvConfigSource argvConfig = new ArgvConfigSource(args);
argvConfig.AddSwitch("Startup", "format", "f");
argvConfig.AddSwitch("Startup", "inifile");
IConfig startupConfig = argvConfig.Configs["Startup"];
string format = startupConfig.GetString("format", "ini");
ConfigurationLoader loader = new ConfigurationLoader();
IConfigSource s = loader.LoadConfigSettings();
IConfigSource s = loader.LoadConfigSettings(startupConfig);
if (format == "mysql")
{