Class: Xively::Command::Help
- Defined in:
- lib/xively-cli/command/help.rb
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
Constructor Details
This class inherits a constructor from Xively::Command::Base
Class Method Details
.usage_for_command(command) ⇒ Object
32 33 34 35 |
# File 'lib/xively-cli/command/help.rb', line 32 def self.usage_for_command(command) command = new.send(:commands)[command] "Usage: xively #{command[:help]}" if command end |
Instance Method Details
#index ⇒ Object
help [COMMAND]
list available commands or display help for a specific command
Examples:
$ xively help Usage: xively COMMAND [–key API_KEY] [command-specific-options]
Primary help topics, type “xively help TOPIC” for more details:
subscribe # subscribe to a datastream
...
21 22 23 24 25 26 27 |
# File 'lib/xively-cli/command/help.rb', line 21 def index if command = args.shift help_for_command(command) else help_for_root end end |