diff --git a/README.md b/README.md index 3b380bd..4a212b9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TOMAS -TOMAS (**To**ny's **Ma**naged Operating **S**ystem) is a operating system based on the [COSMOS](https://github.com/CosmosOS/Cosmos) framework. It comes with a respective terminal emulator. +TOMAS (**To**ny's **Ma**naged Operating **S**ystem) is a hobby operating system based on the [COSMOS](https://github.com/CosmosOS/Cosmos) framework that comes with a respective terminal emulator. ## Requirements @@ -16,4 +16,4 @@ TOMAS (**To**ny's **Ma**naged Operating **S**ystem) is a operating system based ## License -This project is licensed under the GPL 3.0 License - see the [LICENSE](LICENSE) file for details. +This project is licensed under the BSD 3-Clause license - see the [LICENSE](LICENSE) file for details. diff --git a/src/TOMAS.sln b/src/TOMAS.sln index 43e7db3..75fb522 100644 --- a/src/TOMAS.sln +++ b/src/TOMAS.sln @@ -9,6 +9,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig ..\Changelog.md = ..\Changelog.md + ..\.github\workflows\dotnet.yml = ..\.github\workflows\dotnet.yml ..\LICENSE = ..\LICENSE ..\README.md = ..\README.md TOMAS.sln.licenseheader = TOMAS.sln.licenseheader diff --git a/src/Tomas.Terminal/GlobalUsing.cs b/src/Tomas.Terminal/GlobalUsing.cs new file mode 100644 index 0000000..6169845 --- /dev/null +++ b/src/Tomas.Terminal/GlobalUsing.cs @@ -0,0 +1,2 @@ +global using Tomas.Common.Programs; +global using Tomas.Interface; \ No newline at end of file diff --git a/src/Tomas.Terminal/Program.cs b/src/Tomas.Terminal/Program.cs index 66c012c..80f945a 100644 --- a/src/Tomas.Terminal/Program.cs +++ b/src/Tomas.Terminal/Program.cs @@ -1,42 +1,40 @@ -// I license this project under the BSD 3-Clause license. +// I license this project under the BSD 3-Clause license. // See the LICENSE file in the project root for more information. -using System; -namespace Tomas.Terminal +namespace Tomas.Terminal; + +class Program { - class Program - { - static void Main() - { - while (true) - { - var shell = new Shell(); - var command = shell.ReadLine; - var programs = shell.Programs; + static void Main() + { + while (true) + { + var shell = new Shell(); + var command = shell.ReadLine; + var programs = shell.Programs; - if (!programs.TryGetValue(command, out var program)) - { - Console.WriteLine("Command Not Found."); - continue; - } + if (!programs.TryGetValue(command, out var program)) + { + Console.WriteLine("Command Not Found."); + continue; + } - try - { - var start = program.Run(shell); - switch (start) - { - case true: - continue; - case false: - Console.WriteLine("Program closed unexpectedly."); - continue; - } + try + { + var start = program.Run(shell); + switch (start) + { + case true: + continue; + case false: + Console.WriteLine("Program closed unexpectedly."); + continue; + } + } + catch (Exception err) + { + Console.WriteLine(err.Message); + } + } } - catch (Exception err) - { - Console.WriteLine(err.Message); - } - } - } - } } \ No newline at end of file diff --git a/src/Tomas.Terminal/Programs/About.cs b/src/Tomas.Terminal/Programs/About.cs index 2fa812c..bec288e 100644 --- a/src/Tomas.Terminal/Programs/About.cs +++ b/src/Tomas.Terminal/Programs/About.cs @@ -1,12 +1,11 @@ // I license this project under the BSD 3-Clause license. // See the LICENSE file in the project root for more information. -using System; using Tomas.Common; using Tomas.Interface; namespace Tomas.Terminal.Programs { - public class About : IProgram + public class About : IProgram { public bool Run(IShell shell) { diff --git a/src/Tomas.Terminal/Shell.cs b/src/Tomas.Terminal/Shell.cs index eb55d8f..097c79f 100644 --- a/src/Tomas.Terminal/Shell.cs +++ b/src/Tomas.Terminal/Shell.cs @@ -1,33 +1,28 @@ // I license this project under the BSD 3-Clause license. // See the LICENSE file in the project root for more information. -using System; -using System.Collections.Generic; -using Tomas.Common.Programs; -using Tomas.Interface; using Tomas.Terminal.Programs; -namespace Tomas.Terminal +namespace Tomas.Terminal; + +public class Shell : IShell { - public class Shell : IShell - { - const char SYMBOL = '$'; + const char SYMBOL = '$'; - public Dictionary Programs => new Dictionary() + public Dictionary Programs => new() + { + {"about", new About()}, + {"fensay", new FenSay()}, + {"clear", new Clear()}, + {"commands", new Commands()} + }; + + public string ReadLine + { + get { - {"about", new About()}, - {"fensay", new FenSay()}, - {"clear", new Clear()}, - {"commands", new Commands()} - }; - - public string ReadLine - { - get - { - Console.Write(SYMBOL); - var readl = Console.ReadLine(); - return readl; - } - } - } + Console.Write(SYMBOL); + var readl = Console.ReadLine(); + return readl; + } + } } \ No newline at end of file diff --git a/src/Tomas.Terminal/Tomas.Terminal.csproj b/src/Tomas.Terminal/Tomas.Terminal.csproj index 31fe113..f466519 100644 --- a/src/Tomas.Terminal/Tomas.Terminal.csproj +++ b/src/Tomas.Terminal/Tomas.Terminal.csproj @@ -3,13 +3,13 @@ Exe net6.0 - 8 - warnings + enable + enable - - + +