mirror of
https://github.com/tonytins/tomas.git
synced 2025-05-08 15:24:50 -04:00
- Similar project changes to the kernal and resepctive assemblies will be taken more slowly
40 lines
No EOL
1,020 B
C#
40 lines
No EOL
1,020 B
C#
// I license this project under the BSD 3-Clause license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
namespace Tomas.Terminal;
|
|
|
|
class Program
|
|
{
|
|
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;
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
} |