1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

ShowDoc: display "current context" message

Consider the following example:

  [1] pry(main)> show-doc
  Error: No docs found for:
  [2] pry(main)>

The message is ambiguous. This commit adds "current context" label when
`obj_name` return `nil`.

  [1] pry(main)> show-doc
  Error: No docs found for: current context
  [2] pry(main)>
This commit is contained in:
Kyrylo Silin 2013-03-13 13:15:58 +02:00
parent e926d8c944
commit d746eeffe3

View file

@ -35,7 +35,11 @@ class Pry
# command '--help' shouldn't use markup highlighting
docs
else
raise CommandError, "No docs found for: #{obj_name}" if docs.empty?
if docs.empty?
raise CommandError, "No docs found for: #{
obj_name ? obj_name : 'current context'
}"
end
process_comment_markup(docs)
end
end