class Byebug::EnableCommand
def enable_breakpoints(args)
def enable_breakpoints(args) enable_disable_breakpoints("Enable", args) end
def enable_display(args)
def enable_display(args) enable_disable_display("Enable", args) end
def execute
def execute if not @match[1] errmsg "\"enable\" 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("enable_#{subcmd.name}", args) else send("enable_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 \"enable\" subcommand \"#{args[1]}\"." unless subcmd str = subcmd.short_help + '.' str += "\n" + subcmd.long_help if subcmd.long_help return str end # general help s = %{ Enable some things. This is used to cancel the effect of the "disable" command. -- List of enable subcommands: -- } for subcmd in Subcommands do s += "enable #{subcmd.name} -- #{subcmd.short_help}\n" end return s end
def help_command
def help_command 'enable' end
def regexp
def regexp /^\s* en(?:able)? (?:\s+(.*))?$/ix end