Files
Random-Project/TermEngine/Program.cs

38 lines
922 B
C#
Raw Normal View History

2025-07-08 04:29:21 +03:00
using System;
using System.Collections.Generic;
2025-07-09 00:22:59 +03:00
using TermApp.Core;
2025-07-08 04:29:21 +03:00
namespace TermApp
{
class Program
{
static void Main(string[] args)
{
2025-07-09 00:22:59 +03:00
2025-07-08 04:29:21 +03:00
Console.WriteLine("Hello, Works!");
CommandInterpreter interpreter = new CommandInterpreter();
Console.WriteLine("Type help to see avaliable Commands :.) or type exit to quit");
2025-07-09 00:22:59 +03:00
string lastCommand = "Command Cache :)";
2025-07-08 04:29:21 +03:00
while (true)
{
2025-07-09 00:22:59 +03:00
Console.Write($"[{lastCommand}] - Input >");
string input = Console.ReadLine() ?? throw new ArgumentException();
lastCommand = input;
2025-07-08 04:29:21 +03:00
if (string.IsNullOrWhiteSpace(input)) continue;
2025-07-09 00:22:59 +03:00
if (input.ToLower() == "exit" || input.ToLower() == "e") break;
2025-07-08 04:29:21 +03:00
interpreter.Execute(input);
}
}
}
}