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
|
@ -35,7 +35,11 @@ class Pry
|
||||||
# command '--help' shouldn't use markup highlighting
|
# command '--help' shouldn't use markup highlighting
|
||||||
docs
|
docs
|
||||||
else
|
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)
|
process_comment_markup(docs)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue