Class: Cosm::Command::Help
Overview
list commands and display help
Constant Summary collapse
- PRIMARY_NAMESPACES =
%w( subscribe )
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#index ⇒ Object
help [COMMAND].
Methods inherited from Base
alias_command, extract_banner, extract_description, extract_help, extract_help_from_caller, extract_options, extract_summary, inherited, #initialize, method_added, namespace
Constructor Details
This class inherits a constructor from Cosm::Command::Base
Class Method Details
.usage_for_command(command) ⇒ Object
32 33 34 35 |
# File 'lib/cosm/command/help.rb', line 32 def self.usage_for_command(command) command = new.send(:commands)[command] "Usage: cosm #{command[:help]}" if command end |
Instance Method Details
#index ⇒ Object
help [COMMAND]
list available commands or display help for a specific command
Examples:
$ cosm help Usage: cosm COMMAND [–key API_KEY] [command-specific-options]
Primary help topics, type “cosm help TOPIC” for more details:
subscribe # subscribe to a datastream
...
21 22 23 24 25 26 27 |
# File 'lib/cosm/command/help.rb', line 21 def index if command = args.shift help_for_command(command) else help_for_root end end |