mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-08-10 18:19:36 +00:00
add McMaster.Extensions.CommandLineUtils and first sample code
This commit is contained in:
@@ -1,12 +1,38 @@
|
||||
using System;
|
||||
using McMaster.Extensions.CommandLineUtils;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace ElectronNET.CLI
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
static int Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello World from electronize xy");
|
||||
var app = new CommandLineApplication();
|
||||
|
||||
app.Name = "electronnet";
|
||||
app.HelpOption("-?|-h|--help");
|
||||
|
||||
app.OnExecute(() =>
|
||||
{
|
||||
Console.WriteLine("Hello World!");
|
||||
return 0;
|
||||
});
|
||||
|
||||
app.Command("start", (command) => {
|
||||
command.Description = "Start ASP.NET Core project with Electron.";
|
||||
command.HelpOption("-?|-h|--help");
|
||||
|
||||
command.Argument("path", "Path to the ASP.NET Core project");
|
||||
|
||||
command.OnExecute(() => {
|
||||
Console.WriteLine(Directory.GetCurrentDirectory());
|
||||
Console.WriteLine(command.Arguments[0].Value);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return app.Execute(args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user