Sha256: fa69fdc4be3f5a92a9c7a84c4b5c87941e140dda4232100fb841afad17d43e65

Contents?: true

Size: 673 Bytes

Versions: 11

Compression:

Stored size: 673 Bytes

Contents

require_relative 'command_handler'

module Ftpd

  class CmdHelp < CommandHandler

    def cmd_help(argument)
      if argument
        command = argument.upcase
        if supported_commands.include?(command)
          reply "214 Command #{command} is recognized"
        else
          reply "214 Command #{command} is not recognized"
        end
      else
        reply '214-The following commands are recognized:'
        supported_commands.sort.each_slice(8) do |commands|
          line = commands.map do |command|
            '   %-4s' % command
          end.join
          reply line
        end
        reply '214 Have a nice day.'
      end
    end

  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
ftpd-1.1.1 lib/ftpd/cmd_help.rb
ftpd-1.1.0 lib/ftpd/cmd_help.rb
investtools-ftpd-1.0.1 lib/ftpd/cmd_help.rb
ftpd-1.0.1 lib/ftpd/cmd_help.rb
ftpd-1.0.0 lib/ftpd/cmd_help.rb
ftpd-0.17.0 lib/ftpd/cmd_help.rb
ftpd-0.16.0 lib/ftpd/cmd_help.rb
ftpd-0.15.0 lib/ftpd/cmd_help.rb
ftpd-0.14.0 lib/ftpd/cmd_help.rb
ftpd-0.13.0 lib/ftpd/cmd_help.rb
ftpd-0.12.0 lib/ftpd/cmd_help.rb