Sha256: c99d5e3c8b566dee16840c72acfa9c12949448dfd55fcb36ce26214ede83c915

Contents?: true

Size: 834 Bytes

Versions: 5

Compression:

Stored size: 834 Bytes

Contents

class Tane::Commands::Help < Tane::Commands::Base

  class << self
    def process(args)
      if args.count == 0
        puts opts.help_text
        return
      end
      help_for_command args.first.capitalize if args.count != 0
    end
    
    def help_for_command(command)
      klass = Tane::Commands.const_get(command)
      Tane::Commands.const_missing(command) if not klass.respond_to? :help_text
      term.say "\n#{klass.help_text}\n"
    end

    def help_text
      <<-EOL
Usage:

    tane help [command]

Displays the help message with the list commands tane supports. For details about usage about each each command use `tane help name`, where _name_ is the name of the command you need information about. For example

    tane help support
  
displays the information about the support command.
EOL
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tane-0.0.5 lib/tane/commands/help.rb
tane-0.0.4 lib/tane/commands/help.rb
tane-0.0.3 lib/tane/commands/help.rb
tane-0.0.2 lib/tane/commands/help.rb
tane-0.0.1 lib/tane/commands/help.rb