36 lines
962 B
C#
36 lines
962 B
C#
using CommandLine;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Tidstagning
|
|
{
|
|
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<Options>(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<Error> errs)
|
|
{
|
|
MessageBox.Show("Failed to start\n" + errs.ToString());
|
|
}
|
|
|
|
}
|
|
}
|