|
|
@@ -1,8 +1,10 @@
|
|
|
// Copyright (c) .NET Foundation. All rights reserved.
|
|
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
|
|
|
|
|
-using Microsoft.AspNetCore.Components.Web.DevServer.Commands;
|
|
|
-using Microsoft.Extensions.CommandLineUtils;
|
|
|
+using Microsoft.AspNetCore.Hosting;
|
|
|
+using Microsoft.Extensions.Hosting;
|
|
|
+using DevServerProgram = Microsoft.AspNetCore.Components.WebAssembly.DevServer.Server.Program;
|
|
|
+
|
|
|
|
|
|
namespace Microsoft.AspNetCore.Components.WebAssembly.DevServer
|
|
|
{
|
|
|
@@ -10,31 +12,8 @@ namespace Microsoft.AspNetCore.Components.WebAssembly.DevServer
|
|
|
{
|
|
|
static int Main(string[] args)
|
|
|
{
|
|
|
- var app = new CommandLineApplication(throwOnUnexpectedArg: false)
|
|
|
- {
|
|
|
- Name = "blazor-devserver"
|
|
|
- };
|
|
|
- app.HelpOption("-?|-h|--help");
|
|
|
-
|
|
|
- app.Commands.Add(new ServeCommand(app));
|
|
|
-
|
|
|
- // A command is always required
|
|
|
- app.OnExecute(() =>
|
|
|
- {
|
|
|
- app.ShowHelp();
|
|
|
- return 0;
|
|
|
- });
|
|
|
-
|
|
|
- try
|
|
|
- {
|
|
|
- return app.Execute(args);
|
|
|
- }
|
|
|
- catch (CommandParsingException cex)
|
|
|
- {
|
|
|
- app.Error.WriteLine(cex.Message);
|
|
|
- app.ShowHelp();
|
|
|
- return 1;
|
|
|
- }
|
|
|
+ DevServerProgram.BuildWebHost(args).Run();
|
|
|
+ return 0;
|
|
|
}
|
|
|
}
|
|
|
}
|