public static bool ParseCommandLine(string[] commandLine, out Dictionary <string, object> outputArgs) { outputArgs = new Dictionary <string, object>(); // Parse command line arguments and fill application settings for (int i = 0; i < commandLine.Length; i++) { switch (commandLine[i]) { case "-c": case "--controlset": if ((i + 1) < commandLine.Length) { outputArgs.Add("controlset", commandLine[i + 1]); i++; } break; case "-l": case "--logfile": if ((i + 1) < commandLine.Length) { outputArgs.Add("logfile", true); i++; } break; case "-loadxml": SharedData.LoadCfgExtension = ".xml"; break; case "-loadjson": SharedData.LoadCfgExtension = ".json"; break; case "-savexml": SharedData.SaveCfgExtension = ".xml"; break; case "-savejson": SharedData.SaveCfgExtension = ".json"; break; case "-h": case "--help": case "/?": default: // Display help message Console.WriteLine(OSUtilities.AboutString()); Console.WriteLine("Usage:"); Console.WriteLine(" -c --controlset <uniquename>: name to a " + "unique configuration file"); Console.WriteLine(" -l --logfile: force log to DEBUG and output to file"); Console.WriteLine(" -h --help: display this message"); // Leave return(false); } } return(true); }
public static string AboutString() { var copyright = OSUtilities.AssemblyCopyright(); var version = OSUtilities.AssemblyVersion(); string text = "BackForceFeeder for Gamoover by B. Maurin (njz3)\n"; text += copyright; text += "\nVersion " + version.ToString(); text += "\nRunning mode is " + BFFManager.Config.Hardware.TranslatingModes.ToString(); return(text); }