New Commands & piped interpreter!
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TermApp.Core;
|
||||
|
||||
namespace TermApp
|
||||
{
|
||||
@@ -8,20 +9,21 @@ namespace TermApp
|
||||
|
||||
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");
|
||||
|
||||
string lastCommand = "Command Cache :)";
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
||||
Console.Write("Input >");
|
||||
string input = Console.ReadLine();
|
||||
Console.Write($"[{lastCommand}] - Input >");
|
||||
string input = Console.ReadLine() ?? throw new ArgumentException();
|
||||
lastCommand = input;
|
||||
if (string.IsNullOrWhiteSpace(input)) continue;
|
||||
if (input.ToLower() == "exit") break;
|
||||
if (input.ToLower() == "exit" || input.ToLower() == "e") break;
|
||||
|
||||
|
||||
interpreter.Execute(input);
|
||||
|
||||
Reference in New Issue
Block a user