Skip to content

Commit 70bf55c

Browse files
committed
release 1.0.9 fix get vars exception when convert from null + fix comments + integrated xml code spec for intellisense
1 parent bcb4161 commit 70bf55c

File tree

24 files changed

+148
-113
lines changed

24 files changed

+148
-113
lines changed

OrbitalShell-CLI/OrbitalShell-CLI.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<Product>Orbital Shell</Product>
1818
<Description>This is the Orbital Shell CLI binaries for any plateform (having dotnet) and also self-contained apps for common runtimes environments (win-x64,linux-x64,linux-musl-x64,linux-arm,linux-arm64). Orbital Shell is a command shell based inspired by bash and POSIX recommendations, coded in C# .Net Core.</Description>
1919
<Copyright>(c) 2020 Licence MIT</Copyright>
20-
<Version>1.0.8</Version>
21-
<InformationalVersion>1.0.8</InformationalVersion>
20+
<Version>1.0.9</Version>
21+
<InformationalVersion>1.0.9</InformationalVersion>
2222

2323
<PackageReleaseNotes>initial stable release (milestone 1)</PackageReleaseNotes>
2424
<ApplicationIcon>assets\robotazteque.ico</ApplicationIcon>
@@ -54,6 +54,7 @@
5454
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
5555
<Optimize>false</Optimize>
5656
<DocumentationFile>bin/Debug/net5.0/orbsh.xml</DocumentationFile>
57+
<NoWarn>1701;1702;1591;1572;1573</NoWarn>
5758
</PropertyGroup>
5859

5960

OrbitalShell-CLI/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Microsoft.Extensions.DependencyInjection;
22
using Microsoft.Extensions.Hosting;
33

4+
using OrbitalShell.Component.Shell;
45

56
namespace OrbitalShell
67
{
@@ -18,7 +19,8 @@ static int Main(string[] args)
1819
var scope = App.Host.Services.CreateScope();
1920
si.ScopedServiceProvider = scope.ServiceProvider;
2021

21-
var returnCode = Shell.Startup(scope.ServiceProvider,args);
22+
var shellStartup = scope.ServiceProvider.GetRequiredService<IShellStartup>();
23+
var returnCode = shellStartup.Startup(args);
2224

2325
App.Host.RunAsync().Wait();
2426

OrbitalShell-CLI/Scripts/publish-kernel-packages.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,14 @@ echo "(b=darkgreen,f=black) build/publish orbital shell kernel packages (rdc)"
99
echo "(b=darkgreen,f=black) "
1010
echo
1111
proj
12-
dotnet build OrbitalShell.sln -c Debug
12+
#dotnet build OrbitalShell.sln -c Release
1313

14-
nuget-push OrbitalShell-ConsoleApp/bin/Debug/OrbitalShell-ConsoleApp.$version $key
15-
nuget-push OrbitalShell-Kernel/bin/Debug/OrbitalShell-Kernel.$version $key
16-
nuget-push OrbitalShell-Kernel-Commands/bin/Debug/OrbitalShell-Kernel-Commands.$version $key
14+
#nuget-push OrbitalShell-ConsoleApp/bin/Debug/OrbitalShell-ConsoleApp.$version $key
15+
#nuget-push OrbitalShell-Kernel/bin/Debug/OrbitalShell-Kernel.$version $key
16+
#nuget-push OrbitalShell-Kernel-Commands/bin/Debug/OrbitalShell-Kernel-Commands.$version $key
17+
18+
nuget-push OrbitalShell-ConsoleApp/bin/Release/OrbitalShell-ConsoleApp.$version $key
19+
nuget-push OrbitalShell-Kernel/bin/Release/OrbitalShell-Kernel.$version $key
20+
nuget-push OrbitalShell-Kernel-Commands/bin/Release/OrbitalShell-Kernel-Commands.$version $key
1721

1822
echo "(b=darkgreen,f=yellow) Done. (rdc)"

OrbitalShell-CLI/ServicesInitializer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public void InitializeServices(IHostBuilder hostBuilder)
5757
serviceProvider.GetRequiredService<ICommandLineProcessor>());
5858
return clr;
5959
})
60+
.AddScoped
61+
<IShellStartup,ShellStartup>()
6062
);
6163
}
6264
}

OrbitalShell-CLI/Shell.cs

Lines changed: 0 additions & 41 deletions
This file was deleted.

OrbitalShell-CLI/ShellStartup.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using OrbitalShell.Component.CommandLine.Reader;
2+
using OrbitalShell.Component.CommandLine.Processor;
3+
using OrbitalShell.Component.Console;
4+
using OrbitalShell.Component.Shell;
5+
using System;
6+
7+
namespace OrbitalShell
8+
{
9+
public class ShellStartup : IShellStartup
10+
{
11+
IConsole _cons;
12+
ICommandLineProcessor _clp;
13+
ICommandLineReader _clr;
14+
15+
public ShellStartup(
16+
IServiceProvider serviceProvider,
17+
IConsole console,
18+
ICommandLineProcessor commandLineProcessor,
19+
ICommandLineReader commandLineReader
20+
)
21+
{
22+
_cons = console;
23+
_clp = commandLineProcessor;
24+
_clr = commandLineReader;
25+
}
26+
27+
public int Startup(
28+
string[] args)
29+
{
30+
_clp.SetArgs(args);
31+
32+
// prepare console
33+
34+
_cons.Out.Echo(ANSI.RIS);
35+
_cons.Out.ClearScreen();
36+
37+
// invoke a shell initializer associated to the clp
38+
39+
var shellInitializer = new ShellInitializer(_clp);
40+
shellInitializer.Run(_clp.CommandEvaluationContext);
41+
42+
// starts an interactive shell
43+
44+
return _clr.ReadCommandLine();
45+
}
46+
}
47+
}

OrbitalShell-ConsoleApp/App.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace OrbitalShell
1010

1111
/// <summary>
1212
/// console app bootstrap
13-
/// <remarks>
1413
/// </summary>
14+
/// <remarks>
1515
/// begin DI init
1616
/// </remarks>
1717
public static class App

OrbitalShell-ConsoleApp/Component/Console/ANSI.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ public static (SGR_4BitsColors color, bool bright) ParseSGR_4BitsColor(string s)
380380
/// 8- 15: high intensity colors (as in ESC [ 90–97 m, see SGR_4BitsColors bright)<br/>
381381
/// 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5)<br/>
382382
/// 232-255: grayscale from black to white in 24 steps</para>
383-
/// <para>format is {n},0<=n<=255</para>
383+
/// <para>format is {n},0&lt;=n&lt;=255</para>
384384
/// </summary>
385-
/// <param name="s">{n},0<=n<=255</param>
385+
/// <param name="s">{n},0&lt;=n&lt;=255</param>
386386
/// <returns>ansi seq</returns>
387387
public static string SGRF8(object o)
388388
{
@@ -412,9 +412,9 @@ public static string SGRF8(object o)
412412
/// <summary>
413413
/// set foreground color - 24 bits 'true color' (for 16 or 24 bits palette graphic cards)
414414
/// <para>parameters are red,green,blue luminosity from 0 to 255</para>
415-
/// <para>format is: {r}:{g}:{b} 0<=r<=255 0<=g<=255 0<=b<=255</para>
415+
/// <para>format is: {r}:{g}:{b} 0&lt;=r&lt;=255 0&lt;=g&lt;=255 0&lt;=b&lt;=255</para>
416416
/// </summary>
417-
/// <param name="s">{r}:{g}:{b} 0<=r<=255 0<=g<=255 0<=b<=255</param>
417+
/// <param name="s">{r}:{g}:{b} 0&lt;=r&lt;=255 0&lt;=g&lt;=255 0&lt;=b&lt;=255</param>
418418
/// <returns>ansi seq</returns>
419419
public static string SGRF24(object o)
420420
{
@@ -465,7 +465,7 @@ public static string SGRB(object o)
465465
/// set background color - 8 bits palette (256 colors)
466466
/// <para>0- 7: standard colors (as in ESC [ 30–37 m, see SGR_4BitsColors)<br/>
467467
/// 8- 15: high intensity colors (as in ESC [ 90–97 m, see SGR_4BitsColors bright)<br/>
468-
/// 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 r, g, b ≤ 5)<br/>
468+
/// 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 &lt;= r, g, b ≤ 5)<br/>
469469
/// 232-255: grayscale from black to white in 24 steps</para>
470470
/// </summary>
471471
/// <param name="n">palette color index</param>
@@ -478,9 +478,9 @@ public static string SGRB(object o)
478478
/// 8- 15: high intensity colors (as in ESC [ 90–97 m, see SGR_4BitsColors bright)<br/>
479479
/// 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5)<br/>
480480
/// 232-255: grayscale from black to white in 24 steps</para>
481-
/// <para>format is {n},0<=n<=255</para>
481+
/// <para>format is {n},0&lt;=n&lt;=255</para>
482482
/// </summary>
483-
/// <param name="s">{n},0<=n<=255</param>
483+
/// <param name="s">{n},0&lt;=n&lt;=255</param>
484484
/// <returns>ansi seq</returns>
485485
public static string SGRB8(object o)
486486
{
@@ -510,9 +510,9 @@ public static string SGRB8(object o)
510510
/// <summary>
511511
/// set background color - 24 bits 'true color' (for 16 or 24 bits palette graphic cards)
512512
/// <para>parameters are red,green,blue luminosity from 0 to 255</para>
513-
/// <para>format is: {r}:{g}:{b} 0<=r<=255 0<=g<=255 0<=b<=255</para>
513+
/// <para>format is: {r}:{g}:{b} 0&lt;=r&lt;=255 0&lt;=g&lt;=255 0&lt;=b&lt;=255</para>
514514
/// </summary>
515-
/// <param name="s">{r}:{g}:{b} 0<=r<=255 0<=g<=255 0<=b<=255</param>
515+
/// <param name="s">{r}:{g}:{b} 0&lt;=r&lt;=255 0&lt;=g&lt;=255 0&lt;=b&lt;=255</param>
516516
/// <returns>ansi seq</returns>
517517
public static string SGRB24(object o)
518518
{

OrbitalShell-ConsoleApp/Component/Console/TextColor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static int Parse8BitColor(IConsole console, object c)
9393
/// <summary>
9494
/// parse a 24 bit color
9595
/// </summary>
96-
/// <param name="c">string of format: r:g:b where 0<=r,g,b<=255</param>
96+
/// <param name="c">string of format: r:g:b where 0&lt;=r,g,b &lt;255</param>
9797
/// <returns></returns>
9898
public static (int r,int g,int b) Parse24BitColor(IConsole console, object c)
9999
{

OrbitalShell-ConsoleApp/Component/EchoDirective/EchoDirectives.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,8 @@ public enum EchoDirectives
345345
/// </summary>
346346
SGR_RapidBlink,
347347

348-
349348
/// <summary>
350-
///
351-
/// </su
349+
/// Reverse video
352350
/// </summary>
353351
SGR_ReverseVideo,
354352

@@ -393,32 +391,32 @@ public enum EchoDirectives
393391
SGR_NormalIntensity,
394392

395393
/// <summary>
396-
/// Set foreground color - 3/4 bits palette mode : SGRF=0<=n<=7[,bright]
394+
/// Set foreground color - 3/4 bits palette mode : SGRF=0&lt;=n&lt;=7[,bright]
397395
/// </summary>
398396
SGRF,
399397

400398
/// <summary>
401-
/// set foreground color - 8 bits palette (256 colors) : SGRF8=0<=n<=255
399+
/// set foreground color - 8 bits palette (256 colors) : SGRF8=0&lt;=n&lt;=255
402400
/// </summary>
403401
SGRF8,
404402

405403
/// <summary>
406-
/// set foreground color - 24 bits 'true color' : SGRF24=0<=n<=255,0<=n<=255,0<=n<=255 (r,g,b)
404+
/// set foreground color - 24 bits 'true color' : SGRF24=0&lt;=n&lt;=255,0&lt;=n&lt;=255,0&lt;=n&lt;=255 (r,g,b)
407405
/// </summary>
408406
SGRF24,
409407

410408
/// <summary>
411-
/// Set background color - 3/4 bits palette mode : SGRF=0<=n<=7[,bright]
409+
/// Set background color - 3/4 bits palette mode : SGRF=0&lt;=n&lt;=7[,bright]
412410
/// </summary>
413411
SGRB,
414412

415413
/// <summary>
416-
/// set background color - 8 bits palette (256 colors) : SGRF8=0<=n<=255
414+
/// set background color - 8 bits palette (256 colors) : SGRF8=0&lt;=n&lt;=255
417415
/// </summary>
418416
SGRB8,
419417

420418
/// <summary>
421-
/// set background color - 24 bits 'true color' : SGRF24=0<=n<=255,0<=n<=255,0<=n<=255 (r,g,b)
419+
/// set background color - 24 bits 'true color' : SGRF24=0&lt;=n&lt;=255,0&lt;=n&lt;=255,0&lt;=n&lt;=255 (r,g,b)
422420
/// </summary>
423421
SGRB24,
424422

@@ -457,12 +455,12 @@ public enum EchoDirectives
457455
f,
458456

459457
/// <summary>
460-
/// set foreground from 8 bits palette : f8=0<=n<=255
458+
/// set foreground from 8 bits palette : f8=0&lt;=n&lt;=255
461459
/// </summary>
462460
f8,
463461

464462
/// <summary>
465-
/// set foreground from 24 bits color : f24=r:g:b with 0<=r,g,b<=255
463+
/// set foreground from 24 bits color : f24=r:g:b with 0&lt;=r,g,b&lt;=255
466464
/// </summary>
467465
f24,
468466

@@ -472,12 +470,12 @@ public enum EchoDirectives
472470
b,
473471

474472
/// <summary>
475-
/// set background from 8 bits palette : b8=0<=n<=255
473+
/// set background from 8 bits palette : b8=0&lt;=n&lt;=255
476474
/// </summary>
477475
b8,
478476

479477
/// <summary>
480-
/// set background from 24 bits color : b24=r:g:b with 0<=r,g,b<=255
478+
/// set background from 24 bits color : b24=r:g:b with 0&lt;=r,g,b&lt;=255
481479
/// </summary>
482480
b24,
483481

0 commit comments

Comments
 (0)