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
|
|
|
|
2013-01-09 15:23:19 -05:00
|
|
|
banner <<-'BANNER'
|
|
|
|
Show the source for CMD.
|
|
|
|
BANNER
|
|
|
|
|
2012-08-11 21:26:59 -04:00
|
|
|
def process(*args)
|
|
|
|
target = target()
|
|
|
|
|
|
|
|
opts = Slop.parse!(args) do |opt|
|
2013-01-09 15:23:19 -05:00
|
|
|
opt.banner unindent <<-'BANNER'
|
|
|
|
NOTE: show-command is DEPRECATED. Use show-source [command_name] instead.
|
|
|
|
BANNER
|
2012-08-11 21:26:59 -04:00
|
|
|
|
2013-01-09 15:23:19 -05:00
|
|
|
opt.on :h, :help, "This message" do
|
2012-08-11 21:26:59 -04:00
|
|
|
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
|