class Byebug::SetCommand
Implements byebug “set” command.
def description
def description %{Modifies parts of byebug environment. Boolean values take on, off, 1 or 0. You can see these environment settings with the "show" command.} end
def execute
def execute return print SetCommand.help(nil) if SetCommand.names.include?(@match[0]) args = @match[1].split(/[ \t]+/) try_subcmd = args.shift try_subcmd.downcase! if try_subcmd =~ /^no/i set_on = false try_subcmd = try_subcmd[2..-1] else set_on = true end subcmd = Command.find(Subcommands, try_subcmd) return print "Unknown set command \"#{try_subcmd}\"\n" unless subcmd begin set_on = get_onoff(args[0]) if subcmd.is_bool and args.size > 0 rescue RuntimeError return end set_setting(subcmd.name, set_on, args) return print "#{show_setting(subcmd.name)}\n" end
def names
def names %w(set) end
def regexp
def regexp /^\s* set (?:\s+(.*))? \s*$/x end