Class: Couchup::Commands::Help
- Inherits:
-
Object
- Object
- Couchup::Commands::Help
- Defined in:
- lib/couchup/commands/help.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.describe ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/couchup/commands/help.rb', line 23 def self.describe { :description => "Help on the system", :usage => "help [<command>]", :examples => ["help", "help :get"] } end |
Instance Method Details
#run(param = nil) ⇒ Object
4 5 6 7 |
# File 'lib/couchup/commands/help.rb', line 4 def run(param = nil) param.nil? ? show_all : show(param.camelize) nil end |
#show(command) ⇒ Object
8 9 10 11 |
# File 'lib/couchup/commands/help.rb', line 8 def show(command) k = Commands.const_get(command.to_s) ap k.describe end |
#show_all ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/couchup/commands/help.rb', line 13 def show_all Commands.constants.each do |stuff| k = Commands.const_get(stuff) print stuff.underscore print (stuff.underscore.size > 10) ? "\t" : "\t\t" ap k.respond_to?(:describe) ? k.describe[:description] : "No Help" end ap "Type help <command> for more detailed info" end |