Class: Basketcase::HelpCommand
Instance Attribute Summary
Attributes inherited from Command
#comment, #listener, #targets
Instance Method Summary
collapse
Methods inherited from Command
#accept_args, #effective_targets, #initialize, #option_comment, #option_graphical, #option_recurse, #report, #specified_targets
Methods included from Utils
#mkpath
Instance Method Details
#execute ⇒ Object
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/basketcase/help_command.rb', line 13
def execute
if @targets.empty?
puts @basketcase.usage
exit
end
@targets.each do |command_name|
command = make_command(command_name)
puts
puts "% basketcase #{command_name} #{command.synopsis}"
puts
puts command.help.gsub(/^/, " ")
end
end
|
#help ⇒ Object
9
10
11
|
# File 'lib/basketcase/help_command.rb', line 9
def help
"Display usage instructions."
end
|
#synopsis ⇒ Object
5
6
7
|
# File 'lib/basketcase/help_command.rb', line 5
def synopsis
"[<command>]"
end
|