Skip to content

Commit

Permalink
release 1.0.9 fix get vars exception when convert from null + fix com…
Browse files Browse the repository at this point in the history
…ments + integrated xml code spec for intellisense
  • Loading branch information
franck-gaspoz committed Feb 28, 2021
1 parent bcb4161 commit 70bf55c
Show file tree
Hide file tree
Showing 24 changed files with 148 additions and 113 deletions.
5 changes: 3 additions & 2 deletions OrbitalShell-CLI/OrbitalShell-CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<Product>Orbital Shell</Product>
<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>
<Copyright>(c) 2020 Licence MIT</Copyright>
<Version>1.0.8</Version>
<InformationalVersion>1.0.8</InformationalVersion>
<Version>1.0.9</Version>
<InformationalVersion>1.0.9</InformationalVersion>

<PackageReleaseNotes>initial stable release (milestone 1)</PackageReleaseNotes>
<ApplicationIcon>assets\robotazteque.ico</ApplicationIcon>
Expand Down Expand Up @@ -54,6 +54,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
<DocumentationFile>bin/Debug/net5.0/orbsh.xml</DocumentationFile>
<NoWarn>1701;1702;1591;1572;1573</NoWarn>
</PropertyGroup>


Expand Down
4 changes: 3 additions & 1 deletion OrbitalShell-CLI/Program.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

using OrbitalShell.Component.Shell;

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

var returnCode = Shell.Startup(scope.ServiceProvider,args);
var shellStartup = scope.ServiceProvider.GetRequiredService<IShellStartup>();
var returnCode = shellStartup.Startup(args);

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

Expand Down
12 changes: 8 additions & 4 deletions OrbitalShell-CLI/Scripts/publish-kernel-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ echo "(b=darkgreen,f=black) build/publish orbital shell kernel packages (rdc)"
echo "(b=darkgreen,f=black) "
echo
proj
dotnet build OrbitalShell.sln -c Debug
#dotnet build OrbitalShell.sln -c Release

nuget-push OrbitalShell-ConsoleApp/bin/Debug/OrbitalShell-ConsoleApp.$version $key
nuget-push OrbitalShell-Kernel/bin/Debug/OrbitalShell-Kernel.$version $key
nuget-push OrbitalShell-Kernel-Commands/bin/Debug/OrbitalShell-Kernel-Commands.$version $key
#nuget-push OrbitalShell-ConsoleApp/bin/Debug/OrbitalShell-ConsoleApp.$version $key
#nuget-push OrbitalShell-Kernel/bin/Debug/OrbitalShell-Kernel.$version $key
#nuget-push OrbitalShell-Kernel-Commands/bin/Debug/OrbitalShell-Kernel-Commands.$version $key

nuget-push OrbitalShell-ConsoleApp/bin/Release/OrbitalShell-ConsoleApp.$version $key
nuget-push OrbitalShell-Kernel/bin/Release/OrbitalShell-Kernel.$version $key
nuget-push OrbitalShell-Kernel-Commands/bin/Release/OrbitalShell-Kernel-Commands.$version $key

echo "(b=darkgreen,f=yellow) Done. (rdc)"
2 changes: 2 additions & 0 deletions OrbitalShell-CLI/ServicesInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public void InitializeServices(IHostBuilder hostBuilder)
serviceProvider.GetRequiredService<ICommandLineProcessor>());
return clr;
})
.AddScoped
<IShellStartup,ShellStartup>()
);
}
}
Expand Down
41 changes: 0 additions & 41 deletions OrbitalShell-CLI/Shell.cs

This file was deleted.

47 changes: 47 additions & 0 deletions OrbitalShell-CLI/ShellStartup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using OrbitalShell.Component.CommandLine.Reader;
using OrbitalShell.Component.CommandLine.Processor;
using OrbitalShell.Component.Console;
using OrbitalShell.Component.Shell;
using System;

namespace OrbitalShell
{
public class ShellStartup : IShellStartup
{
IConsole _cons;
ICommandLineProcessor _clp;
ICommandLineReader _clr;

public ShellStartup(
IServiceProvider serviceProvider,
IConsole console,
ICommandLineProcessor commandLineProcessor,
ICommandLineReader commandLineReader
)
{
_cons = console;
_clp = commandLineProcessor;
_clr = commandLineReader;
}

public int Startup(
string[] args)
{
_clp.SetArgs(args);

// prepare console

_cons.Out.Echo(ANSI.RIS);
_cons.Out.ClearScreen();

// invoke a shell initializer associated to the clp

var shellInitializer = new ShellInitializer(_clp);
shellInitializer.Run(_clp.CommandEvaluationContext);

// starts an interactive shell

return _clr.ReadCommandLine();
}
}
}
2 changes: 1 addition & 1 deletion OrbitalShell-ConsoleApp/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace OrbitalShell

/// <summary>
/// console app bootstrap
/// <remarks>
/// </summary>
/// <remarks>
/// begin DI init
/// </remarks>
public static class App
Expand Down
18 changes: 9 additions & 9 deletions OrbitalShell-ConsoleApp/Component/Console/ANSI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ public static (SGR_4BitsColors color, bool bright) ParseSGR_4BitsColor(string s)
/// 8- 15: high intensity colors (as in ESC [ 90–97 m, see SGR_4BitsColors bright)<br/>
/// 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5)<br/>
/// 232-255: grayscale from black to white in 24 steps</para>
/// <para>format is {n},0<=n<=255</para>
/// <para>format is {n},0&lt;=n&lt;=255</para>
/// </summary>
/// <param name="s">{n},0<=n<=255</param>
/// <param name="s">{n},0&lt;=n&lt;=255</param>
/// <returns>ansi seq</returns>
public static string SGRF8(object o)
{
Expand Down Expand Up @@ -412,9 +412,9 @@ public static string SGRF8(object o)
/// <summary>
/// set foreground color - 24 bits 'true color' (for 16 or 24 bits palette graphic cards)
/// <para>parameters are red,green,blue luminosity from 0 to 255</para>
/// <para>format is: {r}:{g}:{b} 0<=r<=255 0<=g<=255 0<=b<=255</para>
/// <para>format is: {r}:{g}:{b} 0&lt;=r&lt;=255 0&lt;=g&lt;=255 0&lt;=b&lt;=255</para>
/// </summary>
/// <param name="s">{r}:{g}:{b} 0<=r<=255 0<=g<=255 0<=b<=255</param>
/// <param name="s">{r}:{g}:{b} 0&lt;=r&lt;=255 0&lt;=g&lt;=255 0&lt;=b&lt;=255</param>
/// <returns>ansi seq</returns>
public static string SGRF24(object o)
{
Expand Down Expand Up @@ -465,7 +465,7 @@ public static string SGRB(object o)
/// set background color - 8 bits palette (256 colors)
/// <para>0- 7: standard colors (as in ESC [ 30–37 m, see SGR_4BitsColors)<br/>
/// 8- 15: high intensity colors (as in ESC [ 90–97 m, see SGR_4BitsColors bright)<br/>
/// 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 r, g, b ≤ 5)<br/>
/// 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 &lt;= r, g, b ≤ 5)<br/>
/// 232-255: grayscale from black to white in 24 steps</para>
/// </summary>
/// <param name="n">palette color index</param>
Expand All @@ -478,9 +478,9 @@ public static string SGRB(object o)
/// 8- 15: high intensity colors (as in ESC [ 90–97 m, see SGR_4BitsColors bright)<br/>
/// 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5)<br/>
/// 232-255: grayscale from black to white in 24 steps</para>
/// <para>format is {n},0<=n<=255</para>
/// <para>format is {n},0&lt;=n&lt;=255</para>
/// </summary>
/// <param name="s">{n},0<=n<=255</param>
/// <param name="s">{n},0&lt;=n&lt;=255</param>
/// <returns>ansi seq</returns>
public static string SGRB8(object o)
{
Expand Down Expand Up @@ -510,9 +510,9 @@ public static string SGRB8(object o)
/// <summary>
/// set background color - 24 bits 'true color' (for 16 or 24 bits palette graphic cards)
/// <para>parameters are red,green,blue luminosity from 0 to 255</para>
/// <para>format is: {r}:{g}:{b} 0<=r<=255 0<=g<=255 0<=b<=255</para>
/// <para>format is: {r}:{g}:{b} 0&lt;=r&lt;=255 0&lt;=g&lt;=255 0&lt;=b&lt;=255</para>
/// </summary>
/// <param name="s">{r}:{g}:{b} 0<=r<=255 0<=g<=255 0<=b<=255</param>
/// <param name="s">{r}:{g}:{b} 0&lt;=r&lt;=255 0&lt;=g&lt;=255 0&lt;=b&lt;=255</param>
/// <returns>ansi seq</returns>
public static string SGRB24(object o)
{
Expand Down
2 changes: 1 addition & 1 deletion OrbitalShell-ConsoleApp/Component/Console/TextColor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static int Parse8BitColor(IConsole console, object c)
/// <summary>
/// parse a 24 bit color
/// </summary>
/// <param name="c">string of format: r:g:b where 0<=r,g,b<=255</param>
/// <param name="c">string of format: r:g:b where 0&lt;=r,g,b &lt;255</param>
/// <returns></returns>
public static (int r,int g,int b) Parse24BitColor(IConsole console, object c)
{
Expand Down
24 changes: 11 additions & 13 deletions OrbitalShell-ConsoleApp/Component/EchoDirective/EchoDirectives.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,8 @@ public enum EchoDirectives
/// </summary>
SGR_RapidBlink,


/// <summary>
///
/// </su
/// Reverse video
/// </summary>
SGR_ReverseVideo,

Expand Down Expand Up @@ -393,32 +391,32 @@ public enum EchoDirectives
SGR_NormalIntensity,

/// <summary>
/// Set foreground color - 3/4 bits palette mode : SGRF=0<=n<=7[,bright]
/// Set foreground color - 3/4 bits palette mode : SGRF=0&lt;=n&lt;=7[,bright]
/// </summary>
SGRF,

/// <summary>
/// set foreground color - 8 bits palette (256 colors) : SGRF8=0<=n<=255
/// set foreground color - 8 bits palette (256 colors) : SGRF8=0&lt;=n&lt;=255
/// </summary>
SGRF8,

/// <summary>
/// set foreground color - 24 bits 'true color' : SGRF24=0<=n<=255,0<=n<=255,0<=n<=255 (r,g,b)
/// 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)
/// </summary>
SGRF24,

/// <summary>
/// Set background color - 3/4 bits palette mode : SGRF=0<=n<=7[,bright]
/// Set background color - 3/4 bits palette mode : SGRF=0&lt;=n&lt;=7[,bright]
/// </summary>
SGRB,

/// <summary>
/// set background color - 8 bits palette (256 colors) : SGRF8=0<=n<=255
/// set background color - 8 bits palette (256 colors) : SGRF8=0&lt;=n&lt;=255
/// </summary>
SGRB8,

/// <summary>
/// set background color - 24 bits 'true color' : SGRF24=0<=n<=255,0<=n<=255,0<=n<=255 (r,g,b)
/// 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)
/// </summary>
SGRB24,

Expand Down Expand Up @@ -457,12 +455,12 @@ public enum EchoDirectives
f,

/// <summary>
/// set foreground from 8 bits palette : f8=0<=n<=255
/// set foreground from 8 bits palette : f8=0&lt;=n&lt;=255
/// </summary>
f8,

/// <summary>
/// set foreground from 24 bits color : f24=r:g:b with 0<=r,g,b<=255
/// set foreground from 24 bits color : f24=r:g:b with 0&lt;=r,g,b&lt;=255
/// </summary>
f24,

Expand All @@ -472,12 +470,12 @@ public enum EchoDirectives
b,

/// <summary>
/// set background from 8 bits palette : b8=0<=n<=255
/// set background from 8 bits palette : b8=0&lt;=n&lt;=255
/// </summary>
b8,

/// <summary>
/// set background from 24 bits color : b24=r:g:b with 0<=r,g,b<=255
/// set background from 24 bits color : b24=r:g:b with 0&lt;=r,g,b&lt;=255
/// </summary>
b24,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class NonRecursiveFunctionGrammarParser
#region predefined grammar functions

/// <summary>
/// ascii<32 && !=27 (ANSI Single Code Function)
/// ascii&lt;32 &amp;&amp; !=27 (ANSI Single Code Function)
/// </summary>
public const string SCF = "scf";

Expand Down
5 changes: 3 additions & 2 deletions OrbitalShell-ConsoleApp/OrbitalShell-ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<Product>Orbital Shell - ConsoleApp</Product>
<Description>Orbital Shell console application library</Description>
<Copyright>(c) 2020 Licence MIT</Copyright>
<Version>1.0.8</Version>
<InformationalVersion>1.0.8</InformationalVersion>
<Version>1.0.9</Version>
<InformationalVersion>1.0.9</InformationalVersion>

<PackageReleaseNotes>milestone 1</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down Expand Up @@ -49,6 +49,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DocumentationFile>bin/Debug/net5.0/OrbitalShell-ConsoleApp.xml</DocumentationFile>
<NoWarn>1701;1702;1591;1572;1573</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
7 changes: 3 additions & 4 deletions OrbitalShell-Kernel-Commands/ModuleInfo.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using OrbitalShell.Component.Shell.Module;
using OrbitalShell.Lib;

/// <summary>
/// declare a shell module
/// </summary>
// declare a shell module

[assembly: ShellModule("OrbitalShell-Kernel-Commands")]
[assembly: ModuleTargetPlateform(TargetPlatform.Any)]
[assembly: ModuleShellMinVersion("1.0.8")]
[assembly: ModuleShellMinVersion("1.0.9")]
[assembly: ModuleAuthors("Orbital Shell team")]
namespace OrbitalShell.Kernel.Commands
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<Product>Orbital Shell - Kernel commands module</Product>
<Description>Orbital Shell kernel commands module. Orbital Shell is a command shell based inspired by bash and POSIX recommendations, coded in C# .Net Core</Description>
<Copyright>(c) Orbital Shell 2020</Copyright>
<Version>1.0.8</Version>
<InformationalVersion>1.0.8</InformationalVersion>
<Version>1.0.9</Version>
<InformationalVersion>1.0.9</InformationalVersion>

<PackageReleaseNotes>milestone 1</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down Expand Up @@ -50,6 +50,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>false</Optimize>
<DocumentationFile>bin/Debug/net5.0/OrbitalShell-Kernel-Commands.xml</DocumentationFile>
<NoWarn>1701;1702;1591;1572;1573</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public CommandEvaluationContext(
CommandLineProcessor = commandLineProcessor;
SetStreams(@out, @in, err);
InputData = inputData;

SetupShellEnvVar();
Variables = new Variables((VariableNamespace.env, ShellEnv));
ShellEnv.Initialize(this);
Expand Down
Loading

0 comments on commit 70bf55c

Please sign in to comment.