added --installed-plugins switch to pry binary to list installed plugins with description

This commit is contained in:
John Mair 2011-06-17 01:41:40 +12:00
parent 57073b7334
commit b3138965d5
1 changed files with 11 additions and 0 deletions

11
bin/pry
View File

@ -39,6 +39,8 @@ See: `https://github.com/banister` for more information.
Pry.config.plugins.enabled = false
end
on "installed-plugins", "List installed plugins."
on "simple-prompt", "Enable simple prompt mode" do
Pry.prompt = Pry::SIMPLE_PROMPT
end
@ -63,6 +65,15 @@ See: `https://github.com/banister` for more information.
)
end
if opts["installed-plugins"]
puts "Installed Plugins:"
puts "--"
Pry.locate_plugins.each do |plugin|
puts "#{plugin.name}".ljust(18) + plugin.spec.summary
end
exit
end
# invoked via cli
Pry.cli = true