improved 'help' output

* sections separated by white space
* plugin names are nicely formatted, e.g `Plugin: Exception Explorer v0.1.9`
This commit is contained in:
John Mair 2012-02-23 18:21:31 +13:00
parent 1e49f38a1b
commit 4b53a97afa
2 changed files with 4 additions and 2 deletions

View File

@ -140,7 +140,9 @@ class Pry
when %r{/pry/.*_commands/(.*).rb}
$1.capitalize.gsub(/_/, " ")
when %r{/(pry-[^\/]*)/}
$1
$1 =~ /pry-([\w_]+)-([\d\.]+)/
name, version = $1, $2
"Plugin: #{name.capitalize.gsub(/_/, " ")} v#{version}"
when /pryrc/
"~/.pryrc"
else

View File

@ -363,7 +363,7 @@ class Pry
end
unless commands.empty?
help_text << "#{text.bold(key)}"
help_text << "\n#{text.bold(key)}"
help_text += commands.map do |command|
" #{command.options[:listing].to_s.ljust(18)} #{command.description}"
end