cli/ruby-debug/commands/info.rb in ruby-debug-0.10.3 vs cli/ruby-debug/commands/info.rb in ruby-debug-0.10.4

- old
+ new

@@ -89,11 +89,11 @@ def regexp /^\s* i(?:nfo)? (?:\s+(.*))?$/ix end def execute - if @match[1].empty? + if !@match[1] || @match[1].empty? errmsg "\"info\" must be followed by the name of an info command:\n" print "List of info subcommands:\n\n" for subcmd in Subcommands do print "info #{subcmd.name} -- #{subcmd.short_help}\n" end @@ -140,15 +140,18 @@ return end end print "Num Enb What\n" brkpts.each do |b| + fname = Command.settings[:basename] ? + File.basename(b.source) : b.source + if b.expr.nil? print "%3d %s at %s:%s\n", - b.id, (b.enabled? ? 'y' : 'n'), b.source, b.pos + b.id, (b.enabled? ? 'y' : 'n'), fname, b.pos else print "%3d %s at %s:%s if %s\n", - b.id, (b.enabled? ? 'y' : 'n'), b.source, b.pos, b.expr + b.id, (b.enabled? ? 'y' : 'n'), fname, b.pos, b.expr end hits = b.hit_count if hits > 0 s = (hits > 1) ? 's' : '' print "\tbreakpoint already hit #{hits} time#{s}\n"