AnyEvent::FTP::Server::Role::Help - Help role for FTP server
version 0.03
Create a context:
package AnyEvent::FTP::Server::Context::EchoContext; use Moo; extends 'AnyEvent::FTP::Server::Context'; with 'AnyEvent::FTP::Server::Role::Help'; # implement the non-existent echo command sub help_echo { 'ECHO <SP> text' } sub cmd_echo { my($self, $con, $req) = @_; $con->send_response(211 => $req->args); $self->done; } 1;
Start a server with that context:
% aeftpd --context EchoContext ftp://dfzcgohteq:igdcphxled@localhost:59402
Then connect to that server and test the HELP command:
HELP
% telnet localhost 59402 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 aeftpd dev help 214-The following commands are recognized: 214-ECHO HELP 214 Direct comments to devnull@bogus help help 214 Syntax: HELP [<sp> command] help echo 214 Syntax: ECHO <SP> text help bogus 502 Unknown command quit 221 Goodbye Connection closed by foreign host.
This role provides a standard FTP HELP command. It finds any FTP commands (cmd_*) you have defined in your context class and the associated usage functions (help_*) and implements the HELP command for you.
cmd_*
help_*
author: Graham Ollis <plicease@cpan.org>
contributors:
Ryo Okamoto
Shlomi Fish
This software is copyright (c) 2013 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install AnyEvent::FTP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::FTP
CPAN shell
perl -MCPAN -e shell install AnyEvent::FTP
For more information on module installation, please visit the detailed CPAN module installation guide.