using System;
using System.IO;
using System.Text;

namespace HarosClient.Commands
{
    public class ChangeDirectoryCommand : ICommand
    {
        public string Name { get { return "cd"; } }
        public string Syntax { get { return "cd    <dir>"; } }

        public void Invoke(Client client, StringBuilder output, params string[] args)
        {
            if (args.Length <= 0)
                output.AppendFormat("Error! Expected 1 arg, got {0}", args.Length);
            else
            {
                Directory.SetCurrentDirectory(string.Join(" ", args));
                output.Append("Changed directory");
            }
        }
    }
}

