Class: Byebug::DisableCommand
Constant Summary
collapse
- Subcommands =
[
['breakpoints', 1, 'Disable breakpoints',
'A disabled breakpoint is not forgotten, but has no effect until ' \
'reenabled. Give breakpoint numbers (separated by spaces) as ' \
'arguments or no argument at all if you want to disable every ' \
'breakpoint'],
['display', 1, 'Disable some display expressions when program stops',
'Arguments are the code numbers of the expressions to stop ' \
'displaying. Do "info display" to see the current list of code ' \
'numbers.'],
].map do |name, min, short_help, long_help|
Subcmd.new(name, min, short_help, long_help)
end
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
command_exists?, commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map, terminal_width
Class Method Details
.description ⇒ Object
148
149
150
151
152
153
|
# File 'lib/byebug/commands/enable.rb', line 148
def description
%{Disable breakpoints or displays.
A disabled item is not forgotten, but has no effect until reenabled.
Use the "enable" command to have it take effect again.}
end
|
.names ⇒ Object
144
145
146
|
# File 'lib/byebug/commands/enable.rb', line 144
def names
%w(disable)
end
|
Instance Method Details
#disable_breakpoints(args) ⇒ Object
135
136
137
|
# File 'lib/byebug/commands/enable.rb', line 135
def disable_breakpoints(args)
enable_disable_breakpoints('disable', args)
end
|
#disable_display(args) ⇒ Object
139
140
141
|
# File 'lib/byebug/commands/enable.rb', line 139
def disable_display(args)
enable_disable_display('disable', args)
end
|
#execute ⇒ Object
121
122
123
124
125
126
127
128
129
130
131
132
133
|
# File 'lib/byebug/commands/enable.rb', line 121
def execute
return errmsg "\"disable\" must be followed by \"display\", " \
"\"breakpoints\" or breakpoint numbers.\n" unless @match[1]
args = @match[1].split(/[ \t]+/)
param = args.shift
subcmd = Command.find(Subcommands, param)
if subcmd
send("disable_#{subcmd.name}", args)
else
send('disable_breakpoints', args.unshift(param))
end
end
|
#regexp ⇒ Object
117
118
119
|
# File 'lib/byebug/commands/enable.rb', line 117
def regexp
/^\s* dis(?:able)? (?:\s+(.+))? \s*$/x
end
|