using CommandLine; using System; using System.Collections.Generic; using System.Windows.Forms; namespace Tidstagning { static class Program { public class Options { [Option('c', "config", Required = false, HelpText = "Enable configuration menu.")] public bool Config { get; set; } } [STAThread] static void Main(string[] args) { CommandLine.Parser.Default.ParseArguments(args) .WithParsed(RunOptions) .WithNotParsed(HandleParseError); } static void RunOptions(Options opts) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainUI(opts.Config)); } static void HandleParseError(IEnumerable errs) { MessageBox.Show("Failed to start\n" + errs.ToString()); } } }