Add ability to specify configuration file on the command line
[KiwiIRC.git] / server / kiwi.js
index cd2515579a4605da571c94657617fb90ade4d9c6..44c267eae1cf5b7b661be6e3496048d93df5665d 100755 (executable)
@@ -11,7 +11,18 @@ var fs          = require('fs'),
 
 
 process.chdir(__dirname + '/../');
-config.loadConfig();
+
+(function (argv) {
+    var conf_switch = argv.indexOf('-c');
+    if (conf_switch !== -1) {
+        if (argv[conf_switch + 1]) {
+            return config.loadConfig(argv[conf_switch + 1]);
+        }
+    }
+
+    config.loadConfig();
+
+})(process.argv);
 
 
 // If we're not running in the forground and we have a log file.. switch