lib/byebug/commands/trace.rb in byebug-1.1.0 vs lib/byebug/commands/trace.rb in byebug-1.1.1

- old
+ new

@@ -1,24 +1,20 @@ module Byebug - class TraceCommand < Command # :nodoc: + + class TraceCommand < Command def regexp /^\s* tr(?:ace)? (?: \s+ (\S+)) # on | off | var(iable) (?: \s+ (\S+))? # (all | variable-name)? (?: \s+ (\S+))? \s* # (stop | nostop)? $/ix end def execute if @match[1] =~ /on|off/ onoff = 'on' == @match[1] - #if @match[2] - Byebug.tracing = onoff - print "Tracing is #{onoff ? 'on' : 'off'}\n" - #else - # Byebug.current_context.tracing = onoff - # print "Tracing #{onoff ? 'on' : 'off'} on current thread.\n" - #end + Byebug.tracing = onoff + print "Tracing is #{onoff ? 'on' : 'off'}\n" elsif @match[1] =~ /var(?:iable)?/ varname=@match[2] if debug_eval("defined?(#{varname})") if @match[3] && @match[3] !~ /(:?no)?stop/ errmsg "expecting \"stop\" or \"nostop\"; got \"#{@match[3]}\"\n" @@ -37,17 +33,16 @@ "\"#{@match[1]}\"\n" end end class << self - def help_command - 'trace' + def names + %w(trace) end - def help(cmd) + def description %{ - tr[ace] (on|off)\tset trace mode of current thread - tr[ace] (on|off) all\tset trace mode of all threads + tr[ace] (on|off)\tset trace mode tr[ace] var(iable) VARNAME [stop|nostop]\tset trace variable on VARNAME } end end end