diff --git a/DearFTP/Connection/Commands/CommandsDispatcher.cs b/DearFTP/Connection/Commands/CommandsDispatcher.cs index 85b085e..8f7e33d 100644 --- a/DearFTP/Connection/Commands/CommandsDispatcher.cs +++ b/DearFTP/Connection/Commands/CommandsDispatcher.cs @@ -18,6 +18,7 @@ namespace DearFTP.Connection.Commands new ListCommand(), new ListMachineCommand(), new MakeDirectoryCommand(), + new OptionsCommand(), new ParentDirectoryCommand(), new PassiveCommand(), new PwdCommand(), diff --git a/DearFTP/Connection/Commands/OptionsCommand.cs b/DearFTP/Connection/Commands/OptionsCommand.cs new file mode 100644 index 0000000..28581b6 --- /dev/null +++ b/DearFTP/Connection/Commands/OptionsCommand.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace DearFTP.Connection.Commands +{ + class OptionsCommand : ICommand + { + public string[] Aliases { get; } = new string[] + { + "OPTS" + }; + + public void Execute(Session session, FtpStream stream, string alias, string argument) + { + if (argument.ToUpper().Contains("UTF")) + { + stream.Send(ResponseCode.OK, "UTF8 supported on this server."); + return; + } + + stream.Send(ResponseCode.ArgumentsError, "Requested option not supported"); + } + } +}