diff --git a/Random-Project.sln b/Random-Project.sln new file mode 100644 index 0000000..9264c64 --- /dev/null +++ b/Random-Project.sln @@ -0,0 +1,24 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.2.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TermEngine", "TermEngine\TermEngine.csproj", "{2E1CE255-6C2B-3F7D-A311-6248EEEBF697}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2E1CE255-6C2B-3F7D-A311-6248EEEBF697}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E1CE255-6C2B-3F7D-A311-6248EEEBF697}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E1CE255-6C2B-3F7D-A311-6248EEEBF697}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E1CE255-6C2B-3F7D-A311-6248EEEBF697}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {3F5D4C2B-BB63-46AC-A98C-4B1E46BAA69F} + EndGlobalSection +EndGlobal diff --git a/TermEngine/CommandInterpreter.cs b/TermEngine/CommandInterpreter.cs new file mode 100644 index 0000000..1bba8b8 --- /dev/null +++ b/TermEngine/CommandInterpreter.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; + + +public class CommandInterpreter +{ + public readonly Dictionary _commands = new(); + + public CommandInterpreter() + { + + RegisterCommand(new GreetCommand()); + RegisterCommand(new HelpCommand(this)); + + } + public void RegisterCommand(ICommand command) + { + + _commands[command.Name.ToLower()] = command; + + } + + public void Execute(string input) + { + string[] parts = input.Split(" ", StringSplitOptions.RemoveEmptyEntries); + if (parts.Length == 0) return; + + string commandName = parts[0].ToLower(); + string[] args = parts.Length > 1 ? parts[1..] : new string[0]; + + if (_commands.TryGetValue(commandName, out var command)) + { + + command.Execute(args); + + } + else + { + Console.WriteLine("Err - uknown Command : '{commandName}'. Type help For a list of commands"); + } + + + } + + public IEnumerable GetAllCommands() + { + + return _commands.Values; + + } + + +} \ No newline at end of file diff --git a/TermEngine/GreetCommand.cs b/TermEngine/GreetCommand.cs new file mode 100644 index 0000000..32a35bf --- /dev/null +++ b/TermEngine/GreetCommand.cs @@ -0,0 +1,22 @@ +using System; + +public class GreetCommand : ICommand +{ + public string Name => "greet"; + public string Description => "greets someone.. args [name]"; + + public void Execute(string[] args) + { + + if (args.Length == 0) + { + + Console.WriteLine(Description); + return; + + } + + Console.WriteLine("Greetings , " + args[0]); + + } +} \ No newline at end of file diff --git a/TermEngine/HelpCommand.cs b/TermEngine/HelpCommand.cs new file mode 100644 index 0000000..071e2c2 --- /dev/null +++ b/TermEngine/HelpCommand.cs @@ -0,0 +1,27 @@ +using System; + +public class HelpCommand : ICommand +{ + private readonly CommandInterpreter _interpreter; + + public HelpCommand(CommandInterpreter interpreter) + { + + _interpreter = interpreter; + + } + public string Name => "help"; + public String Description => "Shows the Help pop Up"; + + public void Execute(string[] args) + { + Console.WriteLine("Avaliable Commands:"); + foreach (var cmd in _interpreter.GetAllCommands()) + { + + Console.WriteLine($"Command : {cmd.Name} | {cmd.Description}"); + } + + } + +} \ No newline at end of file diff --git a/TermEngine/ICOmmand.cs b/TermEngine/ICOmmand.cs new file mode 100644 index 0000000..a7756e6 --- /dev/null +++ b/TermEngine/ICOmmand.cs @@ -0,0 +1,8 @@ +public interface ICommand +{ + + string Name { get; } + string Description { get; } + void Execute(string[] args); + +} \ No newline at end of file diff --git a/TermEngine/Program.cs b/TermEngine/Program.cs new file mode 100644 index 0000000..443edbe --- /dev/null +++ b/TermEngine/Program.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; + +namespace TermApp +{ + class Program + { + + static void Main(string[] args) + { + + Console.WriteLine("Hello, Works!"); + + CommandInterpreter interpreter = new CommandInterpreter(); + Console.WriteLine("Type help to see avaliable Commands :.) or type exit to quit"); + + + while (true) + { + + Console.Write("Input >"); + string input = Console.ReadLine(); + if (string.IsNullOrWhiteSpace(input)) continue; + if (input.ToLower() == "exit") break; + + + interpreter.Execute(input); + + + } + + } + + } +} diff --git a/TermEngine/TermEngine.csproj b/TermEngine/TermEngine.csproj new file mode 100644 index 0000000..206b89a --- /dev/null +++ b/TermEngine/TermEngine.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/TermEngine/bin/Debug/net8.0/TermEngine b/TermEngine/bin/Debug/net8.0/TermEngine new file mode 100755 index 0000000..7540b7c Binary files /dev/null and b/TermEngine/bin/Debug/net8.0/TermEngine differ diff --git a/TermEngine/bin/Debug/net8.0/TermEngine.deps.json b/TermEngine/bin/Debug/net8.0/TermEngine.deps.json new file mode 100644 index 0000000..3c89c9e --- /dev/null +++ b/TermEngine/bin/Debug/net8.0/TermEngine.deps.json @@ -0,0 +1,23 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "TermEngine/1.0.0": { + "runtime": { + "TermEngine.dll": {} + } + } + } + }, + "libraries": { + "TermEngine/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/TermEngine/bin/Debug/net8.0/TermEngine.dll b/TermEngine/bin/Debug/net8.0/TermEngine.dll new file mode 100644 index 0000000..de21ca4 Binary files /dev/null and b/TermEngine/bin/Debug/net8.0/TermEngine.dll differ diff --git a/TermEngine/bin/Debug/net8.0/TermEngine.pdb b/TermEngine/bin/Debug/net8.0/TermEngine.pdb new file mode 100644 index 0000000..ce4dbc2 Binary files /dev/null and b/TermEngine/bin/Debug/net8.0/TermEngine.pdb differ diff --git a/TermEngine/bin/Debug/net8.0/TermEngine.runtimeconfig.json b/TermEngine/bin/Debug/net8.0/TermEngine.runtimeconfig.json new file mode 100644 index 0000000..becfaea --- /dev/null +++ b/TermEngine/bin/Debug/net8.0/TermEngine.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/TermEngine/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs b/TermEngine/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs new file mode 100644 index 0000000..dca70aa --- /dev/null +++ b/TermEngine/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.AssemblyInfo.cs b/TermEngine/obj/Debug/net8.0/TermEngine.AssemblyInfo.cs new file mode 100644 index 0000000..c812d7e --- /dev/null +++ b/TermEngine/obj/Debug/net8.0/TermEngine.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("TermEngine")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+fd78d9283e191920ee4f6e700fc03391a8880f43")] +[assembly: System.Reflection.AssemblyProductAttribute("TermEngine")] +[assembly: System.Reflection.AssemblyTitleAttribute("TermEngine")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.AssemblyInfoInputs.cache b/TermEngine/obj/Debug/net8.0/TermEngine.AssemblyInfoInputs.cache new file mode 100644 index 0000000..1725603 --- /dev/null +++ b/TermEngine/obj/Debug/net8.0/TermEngine.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +432712ba9dc98f037959cf0668caa1627ade9f0aa69473645068c6ea52208868 diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.GeneratedMSBuildEditorConfig.editorconfig b/TermEngine/obj/Debug/net8.0/TermEngine.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..a69832d --- /dev/null +++ b/TermEngine/obj/Debug/net8.0/TermEngine.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,13 @@ +is_global = true +build_property.TargetFramework = net8.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = TermEngine +build_property.ProjectDir = /media/kevin/Vr Files/Random-Project/TermEngine/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.GlobalUsings.g.cs b/TermEngine/obj/Debug/net8.0/TermEngine.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/TermEngine/obj/Debug/net8.0/TermEngine.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.assets.cache b/TermEngine/obj/Debug/net8.0/TermEngine.assets.cache new file mode 100644 index 0000000..fb4ecab Binary files /dev/null and b/TermEngine/obj/Debug/net8.0/TermEngine.assets.cache differ diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.csproj.CoreCompileInputs.cache b/TermEngine/obj/Debug/net8.0/TermEngine.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..3b2553a --- /dev/null +++ b/TermEngine/obj/Debug/net8.0/TermEngine.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +4fba7de9be587e6bc37da5c47243a26c97f753def2985a170b262675dd805d5f diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.csproj.FileListAbsolute.txt b/TermEngine/obj/Debug/net8.0/TermEngine.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..3d0397f --- /dev/null +++ b/TermEngine/obj/Debug/net8.0/TermEngine.csproj.FileListAbsolute.txt @@ -0,0 +1,14 @@ +/media/kevin/Vr Files/Random-Project/TermEngine/bin/Debug/net8.0/TermEngine +/media/kevin/Vr Files/Random-Project/TermEngine/bin/Debug/net8.0/TermEngine.deps.json +/media/kevin/Vr Files/Random-Project/TermEngine/bin/Debug/net8.0/TermEngine.runtimeconfig.json +/media/kevin/Vr Files/Random-Project/TermEngine/bin/Debug/net8.0/TermEngine.dll +/media/kevin/Vr Files/Random-Project/TermEngine/bin/Debug/net8.0/TermEngine.pdb +/media/kevin/Vr Files/Random-Project/TermEngine/obj/Debug/net8.0/TermEngine.GeneratedMSBuildEditorConfig.editorconfig +/media/kevin/Vr Files/Random-Project/TermEngine/obj/Debug/net8.0/TermEngine.AssemblyInfoInputs.cache +/media/kevin/Vr Files/Random-Project/TermEngine/obj/Debug/net8.0/TermEngine.AssemblyInfo.cs +/media/kevin/Vr Files/Random-Project/TermEngine/obj/Debug/net8.0/TermEngine.csproj.CoreCompileInputs.cache +/media/kevin/Vr Files/Random-Project/TermEngine/obj/Debug/net8.0/TermEngine.dll +/media/kevin/Vr Files/Random-Project/TermEngine/obj/Debug/net8.0/refint/TermEngine.dll +/media/kevin/Vr Files/Random-Project/TermEngine/obj/Debug/net8.0/TermEngine.pdb +/media/kevin/Vr Files/Random-Project/TermEngine/obj/Debug/net8.0/TermEngine.genruntimeconfig.cache +/media/kevin/Vr Files/Random-Project/TermEngine/obj/Debug/net8.0/ref/TermEngine.dll diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.dll b/TermEngine/obj/Debug/net8.0/TermEngine.dll new file mode 100644 index 0000000..de21ca4 Binary files /dev/null and b/TermEngine/obj/Debug/net8.0/TermEngine.dll differ diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.genruntimeconfig.cache b/TermEngine/obj/Debug/net8.0/TermEngine.genruntimeconfig.cache new file mode 100644 index 0000000..7ef5430 --- /dev/null +++ b/TermEngine/obj/Debug/net8.0/TermEngine.genruntimeconfig.cache @@ -0,0 +1 @@ +7dbdf368ee4ed9dd160116a4ec9cf464a5e24e5ec7e16a587807e5fb5f39987d diff --git a/TermEngine/obj/Debug/net8.0/TermEngine.pdb b/TermEngine/obj/Debug/net8.0/TermEngine.pdb new file mode 100644 index 0000000..ce4dbc2 Binary files /dev/null and b/TermEngine/obj/Debug/net8.0/TermEngine.pdb differ diff --git a/TermEngine/obj/Debug/net8.0/apphost b/TermEngine/obj/Debug/net8.0/apphost new file mode 100755 index 0000000..7540b7c Binary files /dev/null and b/TermEngine/obj/Debug/net8.0/apphost differ diff --git a/TermEngine/obj/Debug/net8.0/ref/TermEngine.dll b/TermEngine/obj/Debug/net8.0/ref/TermEngine.dll new file mode 100644 index 0000000..35785ae Binary files /dev/null and b/TermEngine/obj/Debug/net8.0/ref/TermEngine.dll differ diff --git a/TermEngine/obj/Debug/net8.0/refint/TermEngine.dll b/TermEngine/obj/Debug/net8.0/refint/TermEngine.dll new file mode 100644 index 0000000..35785ae Binary files /dev/null and b/TermEngine/obj/Debug/net8.0/refint/TermEngine.dll differ diff --git a/TermEngine/obj/TermEngine.csproj.nuget.dgspec.json b/TermEngine/obj/TermEngine.csproj.nuget.dgspec.json new file mode 100644 index 0000000..cf3701d --- /dev/null +++ b/TermEngine/obj/TermEngine.csproj.nuget.dgspec.json @@ -0,0 +1,66 @@ +{ + "format": 1, + "restore": { + "/media/kevin/Vr Files/Random-Project/TermEngine/TermEngine.csproj": {} + }, + "projects": { + "/media/kevin/Vr Files/Random-Project/TermEngine/TermEngine.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/media/kevin/Vr Files/Random-Project/TermEngine/TermEngine.csproj", + "projectName": "TermEngine", + "projectPath": "/media/kevin/Vr Files/Random-Project/TermEngine/TermEngine.csproj", + "packagesPath": "/home/kevin/.nuget/packages/", + "outputPath": "/media/kevin/Vr Files/Random-Project/TermEngine/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/kevin/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/home/kevin/.dotnet/sdk/8.0.411/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/TermEngine/obj/TermEngine.csproj.nuget.g.props b/TermEngine/obj/TermEngine.csproj.nuget.g.props new file mode 100644 index 0000000..00d3656 --- /dev/null +++ b/TermEngine/obj/TermEngine.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/kevin/.nuget/packages/ + /home/kevin/.nuget/packages/ + PackageReference + 6.11.1 + + + + + \ No newline at end of file diff --git a/TermEngine/obj/TermEngine.csproj.nuget.g.targets b/TermEngine/obj/TermEngine.csproj.nuget.g.targets new file mode 100644 index 0000000..3dc06ef --- /dev/null +++ b/TermEngine/obj/TermEngine.csproj.nuget.g.targets @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/TermEngine/obj/project.assets.json b/TermEngine/obj/project.assets.json new file mode 100644 index 0000000..d39f953 --- /dev/null +++ b/TermEngine/obj/project.assets.json @@ -0,0 +1,71 @@ +{ + "version": 3, + "targets": { + "net8.0": {} + }, + "libraries": {}, + "projectFileDependencyGroups": { + "net8.0": [] + }, + "packageFolders": { + "/home/kevin/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/media/kevin/Vr Files/Random-Project/TermEngine/TermEngine.csproj", + "projectName": "TermEngine", + "projectPath": "/media/kevin/Vr Files/Random-Project/TermEngine/TermEngine.csproj", + "packagesPath": "/home/kevin/.nuget/packages/", + "outputPath": "/media/kevin/Vr Files/Random-Project/TermEngine/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/kevin/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/home/kevin/.dotnet/sdk/8.0.411/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/TermEngine/obj/project.nuget.cache b/TermEngine/obj/project.nuget.cache new file mode 100644 index 0000000..dacc42c --- /dev/null +++ b/TermEngine/obj/project.nuget.cache @@ -0,0 +1,8 @@ +{ + "version": 2, + "dgSpecHash": "HBGrX670slw=", + "success": true, + "projectFilePath": "/media/kevin/Vr Files/Random-Project/TermEngine/TermEngine.csproj", + "expectedPackageFiles": [], + "logs": [] +} \ No newline at end of file