class Pry::Command::Wtf
def backtrace
def backtrace exception.backtrace end
def exception
def exception _pry_.last_exception end
def options(opt)
def options(opt) opt.on :v, :verbose, "Show the full backtrace" end
def process
def process raise Pry::CommandError, "No most-recent exception" unless exception output.puts "#{text.bold('Exception:')} #{exception.class}: #{exception}\n--" if opts.verbose? output.puts with_line_numbers(backtrace) else output.puts with_line_numbers(backtrace.first(size_of_backtrace)) end end
def size_of_backtrace
def size_of_backtrace [captures[0].size, 0.5].max * 10 d
def with_line_numbers(bt)
def with_line_numbers(bt) Pry::Code.new(bt, 0, :text).with_line_numbers.to_s end