class Byebug::DisableCommand
def disable_breakpoints(args)
def disable_breakpoints(args) enable_disable_breakpoints("Disable", args) end
def disable_display(args)
def disable_display(args) enable_disable_display("Disable", args) end
def execute
def execute if not @match[1] errmsg "\"disable\" must be followed \"display\", \"breakpoints\"" + " or breakpoint numbers.\n" else args = @match[1].split(/[ \t]+/) param = args.shift subcmd = find(Subcommands, param) if subcmd send("disable_#{subcmd.name}", args) else send("disable_breakpoints", args.unshift(param)) end end end
def help(args)
def help(args) # specific subcommand help if args[1] subcmd = find(Subcommands, args[1]) return "Invalid \"disable\" subcommand \"#{args[1]}\"." unless subcmd str = subcmd.short_help + '.' str += "\n" + subcmd.long_help if subcmd.long_help return str end # general help s = %{ Disable some things. A disabled item is not forgotten, but has no effect until reenabled. Use the "enable" command to have it take effect again. -- List of disable subcommands: -- } for subcmd in Subcommands do s += "disable #{subcmd.name} -- #{subcmd.short_help}\n" end return s end
def help_command
def help_command 'disable' end
def regexp
def regexp /^\s* dis(?:able)? (?:\s+(.*))?$/ix end