From 3db9b847bfc9d1b2619e3467ba4bc34d9d4e5edc Mon Sep 17 00:00:00 2001
From: Diva Canto
Date: Wed, 7 May 2014 16:59:11 -0700
Subject: Allow Tools.Configger to take -inifile as argument
---
OpenSim/Tools/Configger/ConfigurationLoader.cs | 12 ++++++------
OpenSim/Tools/Configger/Main.cs | 5 +++--
2 files changed, 9 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Tools')
diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs
index 0b6ee9c..4820e0b 100644
--- a/OpenSim/Tools/Configger/ConfigurationLoader.cs
+++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs
@@ -64,14 +64,14 @@ namespace OpenSim.Tools.Configger
///
///
/// A configuration that gets passed to modules
- public IConfigSource LoadConfigSettings()
+ public IConfigSource LoadConfigSettings(IConfig startupConfig)
{
bool iniFileExists = false;
List sources = new List();
- 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);
}
}
diff --git a/OpenSim/Tools/Configger/Main.cs b/OpenSim/Tools/Configger/Main.cs
index 61a12e3..d7d918b 100644
--- a/OpenSim/Tools/Configger/Main.cs
+++ b/OpenSim/Tools/Configger/Main.cs
@@ -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")
{
--
cgit v1.1