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)>
Wrap command descriptions to 80 characters. Convert some string options
to symbols (where possible). Align options in code. Remove dots in the
end of switch descriptions.
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
John "banister" Mair describes the following key features of commands
as classes:
1. It enables people to extend them by either subclassing or
monkeypatching.
2. It enables them to provide their own API, so that for example, the
Pry::Command::Edit class could have class methods for people to
configure it.
Please, note that I didn't touch easter eggs commands. I also prettified
some strings (your source code reading experience should vastly improve!).
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Pry::CodeObject::Helpers mixin provides the following methods:
command?
module_with_yard_docs?
real_method_object?
c_method?
which are then mixed into the code objects: Pry::Command, Pry::Method, Pry::WrappedModule, Pry::WrappedModule::Candidate
Until we find a better home for it, the code for the complete() method is exactly
the same in each case so we should come up with a way for show-source/show-doc to share it.