lib/byebug/commands/set.rb in byebug-3.1.2 vs lib/byebug/commands/set.rb in byebug-3.2.0
- old
+ new
@@ -1,8 +1,6 @@
module Byebug
-
- # Implements byebug "set" command.
class SetCommand < Command
self.allow_in_control = true
def regexp
/^\s* set (?:\s+(?<setting>\w+))? (?:\s+(?<value>\S+))? \s*$/x
@@ -18,27 +16,27 @@
if !Setting.boolean?(full_key) && value.nil?
return print "You must specify a value for setting :#{key}\n"
elsif Setting.boolean?(full_key)
value = get_onoff(value, key =~ /^no/ ? false : true)
elsif Setting.integer?(full_key)
- return unless value = get_int(value, full_key, 1, 300)
+ return unless value = get_int(value, full_key, 1)
end
Setting[full_key.to_sym] = value
return print Setting.settings[full_key.to_sym].to_s
end
def get_onoff(arg, default)
return default if arg.nil?
case arg
- when '1', 'on'
+ when '1', 'on', 'true'
return true
- when '0', 'off'
+ when '0', 'off', 'false'
return false
else
- print "Expecting 'on', 1, 'off', or 0. Got: #{arg}.\n"
+ print "Expecting 'on', 1, true, 'off', 0, false. Got: #{arg}.\n"
raise RuntimeError
end
end
class << self
@@ -67,7 +65,6 @@
description + Setting.format()
end
end
end
-
end