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