-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from OrbitalShell/feature-startup-args
Feature startup args
- Loading branch information
Showing
39 changed files
with
1,317 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{ | ||
// map shell environment variables and namespaces | ||
|
||
"env": { | ||
|
||
"debug": { | ||
|
||
"enableHookTrace": false, | ||
"enablePipelineTrace": false | ||
|
||
}, | ||
|
||
"settings": { | ||
|
||
"clp": { | ||
|
||
"enableShellExecTraceProcessStart": false, | ||
"enableShellExecTraceProcessEnd": false, | ||
"shellExecBatchExt": ".sh" | ||
|
||
}, | ||
|
||
"clr": { | ||
|
||
"comPreAnalysisOutput": "\r\n", | ||
"comPostExecOutModifiedOutput": "\r\n", | ||
"comPostExecOutput": "" | ||
|
||
}, | ||
|
||
"console": { | ||
|
||
"prompt": "> ", | ||
"initialWindowWidth": -1, | ||
"initialWindowHeight": -1, | ||
"enableCompatibilityMode": false, | ||
"enableAvoidEndOfLineFilledWithBackgroundColor": true, | ||
|
||
"banner": { | ||
|
||
"path": "./Commands/CommandLineProcessor/banner-4.txt", | ||
"isEnabled": true, | ||
"startColorIndex": 21, | ||
"startColorIndex2": 49, | ||
"colorIndexStep": 6 | ||
} | ||
|
||
}, | ||
|
||
"module": { | ||
|
||
"providerUrls": [ | ||
"https://raw.githubusercontent.com/OrbitalShell/Orbital-Shell/master/module-index-repository/module-list.json", | ||
"https://raw.githubusercontent.com/OrbitalShell/Orbital-Shell/dev/module-index-repository/module-list.json" | ||
] | ||
|
||
} | ||
|
||
}, | ||
|
||
"display": { | ||
|
||
} | ||
}, | ||
|
||
"local": { | ||
|
||
}, | ||
|
||
"global": { | ||
|
||
}, | ||
|
||
"_": { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,35 @@ | ||
using System.Threading.Tasks; | ||
|
||
| ||
using Microsoft.Extensions.DependencyInjection; | ||
using Microsoft.Extensions.Hosting; | ||
|
||
using OrbitalShell.Component.Shell; | ||
using OrbitalShell.Component.CommandLine.Processor; | ||
using OrbitalShell.Component.Shell.Init; | ||
|
||
namespace OrbitalShell | ||
{ | ||
public static class Program | ||
{ | ||
static async Task<int> Main(string[] args) | ||
=> await RunShell(args); | ||
|
||
public static async Task<int> RunShell(string[] args) | ||
static int Main(string[] args) | ||
{ | ||
var shellStartup = InitializeShell(args); | ||
|
||
var returnCode = shellStartup.Startup(args); | ||
var returnCode = | ||
GetShellServiceHost(args) | ||
.RunShellServiceHost(args); | ||
|
||
await App.Host.RunAsync(); | ||
App.Host.Run(); | ||
|
||
return returnCode; | ||
} | ||
|
||
public static IShellStartup InitializeShell(string[] args) | ||
{ | ||
App.InitializeServices(System.Array.Empty<string>()); | ||
|
||
var si = new ServicesInitializer(); | ||
si.InitializeServices(App.HostBuilder); | ||
|
||
App.EndInitializeServices(); | ||
|
||
var scope = App.Host.Services.CreateScope(); | ||
si.ScopedServiceProvider = scope.ServiceProvider; | ||
|
||
return scope.ServiceProvider.GetRequiredService<IShellStartup>(); | ||
} | ||
public static IShellServiceHost GetShellServiceHost(string[] args) | ||
=> ShellServiceHost.GetShellServiceHost( | ||
args, | ||
(hostBuilder) => | ||
hostBuilder.ConfigureServices( | ||
(_, services) => | ||
services.AddScoped | ||
<ICommandLineProcessorSettings, OrbitalShellCommandLineProcessorSettings>() | ||
) | ||
); | ||
} | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.