Allow Tools.Configger to take -inifile as argument
parent
13b2ac1425
commit
3db9b847bf
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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")
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue