Options[args[1]] = args[2];
ApplyOptions();
break;
+ case "save":
+ SaveConfig();
+ break;
+ default:
+ bool found;
+ if (args.Length > 1) {
+ string[] callargs = new string[args.Length - 1];
+ Array.Copy(args, 1, callargs, 0, args.Length - 1);
+ found = wt.Plugins.Call(args[0], callargs);
+ if (!found)
+ Error("No function {0}({1}) found", args[0], String.Join(", ", callargs));
+ } else {
+ found = wt.Plugins.Call(args[0]);
+ if (!found)
+ Error("No function {0}() found", args[0]);
+ }
+ if (found)
+ Console.WriteLine("Plugin function {0} called successfully", args[0]);
+ break;
}
CommandlineHide();
}
foreach (string key in Options.Keys) {
switch(key) {
case "ShowTabs":
- bool v = ParseBool(Options[key]);
+ bool v = Config.ParseBool(Options[key]);
wt.Tabs.ShowTabs = v;
break;
default:
}
}
- private bool ParseBool(string v) {
- switch(v.ToLower()) {
- case "true":
- case "t":
- case "1":
- case "on":
- case "yes":
- return true;
- }
- return false;
- }
-
private void Error(string format, params object[] values) {
Console.WriteLine(format, values);
}