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:
parent
e926d8c944
commit
d746eeffe3
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue