lib/byebug/commands/enable.rb in byebug-1.8.2 vs lib/byebug/commands/enable.rb in byebug-2.0.0
- old
+ new
@@ -14,19 +14,19 @@
args.each do |pos|
pos = get_int(pos, "#{is_enable} breakpoints", 1, largest)
return nil unless pos
breakpoints.each do |b|
if b.id == pos
- enabled = ('Enable' == is_enable)
+ enabled = ('enable' == is_enable)
if enabled
unless syntax_valid?(b.expr)
errmsg "Expression \"#{b.expr}\" syntactically incorrect; " \
"breakpoint remains disabled.\n"
break
end
end
- b.enabled = ('Enable' == is_enable)
+ b.enabled = ('enable' == is_enable)
break
end
end
end
end
@@ -37,11 +37,11 @@
return
end
args.each do |pos|
pos = get_int(pos, "#{is_enable} display", 1, @state.display.size)
return nil unless pos
- @state.display[pos-1][0] = ('Enable' == is_enable)
+ @state.display[pos-1][0] = ('enable' == is_enable)
end
end
end
class EnableCommand < Command
@@ -50,19 +50,19 @@
['breakpoints', 2, 'Enable specified breakpoints',
'Give breakpoint numbers (separated by spaces) as arguments. This is ' \
'used to cancel the effect of the "disable" command.'],
['display', 2,
'Enable some expressions to be displayed when program stops',
- 'Arguments are the code numbers of the expressions to resume ' \
+ 'Arguments are the code numbers of the expressions to resume ' \
'displaying. Do "info display" to see the current list of code ' \
'numbers.'],
].map do |name, min, short_help, long_help|
- SubcmdStruct.new(name, min, short_help, long_help)
+ Subcmd.new(name, min, short_help, long_help)
end unless defined?(Subcommands)
def regexp
- /^\s* en(?:able)? (?:\s+(.+))? \s*$/ix
+ /^\s* en(?:able)? (?:\s+(.+))? \s*$/x
end
def execute
return errmsg "\"enable\" must be followed by \"display\", " \
"\"breakpoints\" or breakpoint numbers.\n" unless @match[1]
@@ -76,15 +76,15 @@
send('enable_breakpoints', args.unshift(param))
end
end
def enable_breakpoints(args)
- enable_disable_breakpoints('Enable', args)
+ enable_disable_breakpoints('enable', args)
end
def enable_display(args)
- enable_disable_display('Enable', args)
+ enable_disable_display('enable', args)
end
class << self
def names
%w(enable)
@@ -108,15 +108,15 @@
['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|
- SubcmdStruct.new(name, min, short_help, long_help)
+ Subcmd.new(name, min, short_help, long_help)
end unless defined?(Subcommands)
def regexp
- /^\s* dis(?:able)? (?:\s+(.+))? \s*$/ix
+ /^\s* dis(?:able)? (?:\s+(.+))? \s*$/x
end
def execute
return errmsg "\"disable\" must be followed by \"display\", " \
"\"breakpoints\" or breakpoint numbers.\n" unless @match[1]
@@ -130,14 +130,14 @@
send('disable_breakpoints', args.unshift(param))
end
end
def disable_breakpoints(args)
- enable_disable_breakpoints('Disable', args)
+ enable_disable_breakpoints('disable', args)
end
def disable_display(args)
- enable_disable_display('Disable', args)
+ enable_disable_display('disable', args)
end
class << self
def names
%w(disable)