opt.on:m,:method,"Play a method's source.",:argument=>truedo|meth_name|
meth=get_method_or_raise(meth_name,target,{})
self.content<<meth.source
end
opt.on:d,:doc,"Play a method's documentation.",:argument=>truedo|meth_name|
meth=get_method_or_raise(meth_name,target,{})
text.no_colordo
self.content<<process_comment_markup(meth.doc)
end
end
opt.on:c,:command,"Play a command's source.",:argument=>truedo|command_name|
command=find_command(command_name)
block=Pry::Method.new(command.block)
self.content<<block.source
end
opt.on:f,:file,"Play a file.",:argument=>truedo|file|
self.content<<File.read(File.expand_path(file))
end
opt.on:l,:lines,"Only play a subset of lines.",:optional_argument=>true,:as=>Range,:default=>1..-1
opt.on:i,:in,"Play entries from Pry's input expression history. Takes an index or range. Note this can only replay pure Ruby code, not Pry commands.",:optional_argument=>true,
:as=>Range,:default=>-5..-1do|range|
input_expressions=_pry_.input_array[range]||[]
Array(input_expressions).each{|v|self.content<<v}
end
opt.on:o,"open",'When used with the -m switch, it plays the entire method except the last line, leaving the method definition "open". `amend-line` can then be used to modify the method.'