Class: HTTY::CLI::Commands::Help

Inherits:
HTTY::CLI::Command show all
Includes:
Display
Defined in:
lib/htty/cli/commands/help.rb

Overview

Encapsulates the help command.

Constant Summary

Constant Summary

Constants included from Display

Display::FORMATS

Instance Attribute Summary

Attributes inherited from HTTY::CLI::Command

#arguments, #session

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Display

#break, #format, #formatted_prompt_for, #indent, #logotype, #normal, #notice, #pluralize, #rescuing_from, #say, #say_goodbye, #say_header, #say_hello, #show_headers, #show_request, #show_response, #strong, #word_wrap, #word_wrap_indented

Methods inherited from HTTY::CLI::Command

#add_request_if_new, alias_for, aliases, build_for, category, command_line, complete_for?, #initialize, notify_if_cookies_cleared, raw_name, sanitize_arguments, see_also_commands

Constructor Details

This class inherits a constructor from HTTY::CLI::Command

Class Method Details

.command_line_argumentsObject

Returns the arguments for the command-line usage of the help command.



9
10
11
# File 'lib/htty/cli/commands/help.rb', line 9

def self.command_line_arguments
  '[COMMAND]'
end

.helpObject

Returns the help text for the help command.



14
15
16
# File 'lib/htty/cli/commands/help.rb', line 14

def self.help
  'Displays this help table, or help on the specified command'
end

.help_extendedObject

Returns the extended help text for the help command.



19
20
21
22
# File 'lib/htty/cli/commands/help.rb', line 19

def self.help_extended
  'Displays a table containing available commands and a brief description ' +
  'of each, or detailed help on the specified command.'
end

Instance Method Details

#performObject

Performs the help command.



25
26
27
28
29
# File 'lib/htty/cli/commands/help.rb', line 25

def perform
  return display_help if arguments.empty?

  display_help_for(*arguments)
end