31 lines
555 B
C#
31 lines
555 B
C#
|
|
using TermApp.Core;
|
||
|
|
using System;
|
||
|
|
using System.ComponentModel;
|
||
|
|
|
||
|
|
|
||
|
|
namespace TermApp.Commands
|
||
|
|
{
|
||
|
|
|
||
|
|
public class EchoCommand : ICommand
|
||
|
|
{
|
||
|
|
|
||
|
|
public string Name => "echo";
|
||
|
|
public string Description => "Prints Input";
|
||
|
|
|
||
|
|
|
||
|
|
public void Execute(string[] args, string input = null)
|
||
|
|
{
|
||
|
|
|
||
|
|
if (args.Length > 0)
|
||
|
|
Console.WriteLine(String.Join(" ", args));
|
||
|
|
else if (input != null)
|
||
|
|
Console.WriteLine(input);
|
||
|
|
else
|
||
|
|
Console.WriteLine();
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
}
|