2012-08-11 20:22:29 -04:00
|
|
|
class Pry
|
2012-12-25 16:35:17 -05:00
|
|
|
class Command::ShowCommand < Pry::ClassCommand
|
|
|
|
match 'show-command'
|
2012-08-11 21:26:59 -04:00
|
|
|
group 'Introspection'
|
2012-12-25 16:35:17 -05:00
|
|
|
description 'Show the source for CMD.'
|
2012-08-11 21:26:59 -04:00
|
|
|
|
|
|
|
def process(*args)
|
|
|
|
target = target()
|
|
|
|
|
|
|
|
opts = Slop.parse!(args) do |opt|
|
|
|
|
opt.banner unindent <<-USAGE
|
2012-08-18 20:32:10 -04:00
|
|
|
NOTE: show-command is DEPRECATED. Use show-source [command_name] instead.
|
2012-08-11 21:26:59 -04:00
|
|
|
USAGE
|
|
|
|
|
|
|
|
opt.on :h, :help, "This message." do
|
|
|
|
output.puts opt.help
|
|
|
|
end
|
2012-08-11 20:22:29 -04:00
|
|
|
end
|
|
|
|
|
2012-08-13 23:54:07 -04:00
|
|
|
render_output opts.banner
|
2012-08-11 20:22:29 -04:00
|
|
|
end
|
|
|
|
end
|
2012-12-25 16:35:17 -05:00
|
|
|
|
|
|
|
Pry::Commands.add_command(Pry::Command::ShowCommand)
|
2012-08-11 20:22:29 -04:00
|
|
|
end
|