Files
Random-Project/TermEngine/Commands/HelpCommand.cs

36 lines
648 B
C#
Raw Normal View History

2025-07-08 04:29:21 +03:00
using System;
2025-07-09 00:22:59 +03:00
using TermApp.Core;
namespace TermApp.Commands
{
2025-07-08 04:29:21 +03:00
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";
2025-07-09 00:22:59 +03:00
public void Execute(string[] args, string input = null)
2025-07-08 04:29:21 +03:00
{
Console.WriteLine("Avaliable Commands:");
2025-07-09 00:22:59 +03:00
foreach (var cmd in _interpreter.GetAllCommands())
2025-07-08 04:29:21 +03:00
{
Console.WriteLine($"Command : {cmd.Name} | {cmd.Description}");
}
}
2025-07-09 00:22:59 +03:00
}
}