Class: Byebug::HelpCommand
Overview
Ask for help from byebug’s prompt.
Instance Attribute Summary
Attributes inherited from Command
#processor
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
#arguments, columnize, #context, #frame, help, #initialize, match, to_s
#camelize, #prettify
Class Method Details
.description ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/byebug/commands/help.rb', line 16
def self.description
<<-EOD
h[elp][ <cmd>[ <subcmd>]]
#{short_description}
help -- prints a summary of all commands
help <cmd> -- prints help on command <cmd>
help <cmd> <subcmd> -- prints help on <cmd>'s subcommand <subcmd>
EOD
end
|
.regexp ⇒ Object
12
13
14
|
# File 'lib/byebug/commands/help.rb', line 12
def self.regexp
/^\s* h(?:elp)? (?:\s+(\S+))? (?:\s+(\S+))? \s*$/x
end
|
.short_description ⇒ Object
28
29
30
|
# File 'lib/byebug/commands/help.rb', line 28
def self.short_description
'Helps you using byebug'
end
|
Instance Method Details
#execute ⇒ Object
32
33
34
35
36
37
38
|
# File 'lib/byebug/commands/help.rb', line 32
def execute
return help_for_all unless @match[1]
return help_for(@match[1], command) unless @match[2]
help_for(@match[2], subcommand)
end
|