Readd commandline parsing
This commit is contained in:
15
Program.cs
15
Program.cs
@ -1,5 +1,5 @@
|
||||
using System;
|
||||
using System.CommandLine;
|
||||
using CommandLine;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@ -8,12 +8,23 @@ namespace Tidstagning
|
||||
class Program
|
||||
{
|
||||
|
||||
public class Options
|
||||
{
|
||||
[Option('c', "config", Required = false, HelpText = "Enable configuration menu.")]
|
||||
public bool Verbose { get; set; }
|
||||
}
|
||||
[STAThread]
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Parser.Default.ParseArguments<Options>(args)
|
||||
.WithParsed<Options>(o =>
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new MainUI());
|
||||
Application.Run(new MainUI(o.Verbose));
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="System.IO.Ports" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
Reference in New Issue
Block a user