Skip to content

Consider letting help fall back to RI documentation #1242

Description

@ohboyd

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:

irb> show_doc Array

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions