I noticed that:
irb> help Array
Can't find command `Array`. Please check the command name and try again.
even though IRB can already look up the same documentation with:
I dug into ShowDoc a bit and saw that it uses RDoc::RI::Driver, so it seems like help could potentially make use of the same functionality.
I'm wondering if it would make sense for help to fall back to RI when the requested name isn't an IRB command.
There seem to be two reasonable ways to handle this:
help Array could tell the user to use show_doc Array.
help Array could just display the RI documentation directly, effectively making help a more general entry point for both IRB commands and Ruby documentation.
The second option seems particularly convenient, but I wasn't sure which behavior would fit better with IRB's intended interface.
Would either of these be desirable? If so, I'd be interested in taking a shot at implementing it.
I noticed that:
even though IRB can already look up the same documentation with:
I dug into ShowDoc a bit and saw that it uses RDoc::RI::Driver, so it seems like help could potentially make use of the same functionality.
I'm wondering if it would make sense for help to fall back to RI when the requested name isn't an IRB command.
There seem to be two reasonable ways to handle this:
help Arraycould tell the user to use show_doc Array.help Arraycould just display the RI documentation directly, effectively making help a more general entry point for both IRB commands and Ruby documentation.The second option seems particularly convenient, but I wasn't sure which behavior would fit better with IRB's intended interface.
Would either of these be desirable? If so, I'd be interested in taking a shot at implementing it.