Skip to content

Proposal: Rename the current help command so it can be used to display command documentation #450

@st0012

Description

@st0012

This proposal includes 3 changes:

  1. Add documentation API to command classes. For example, if we want to have pry-style APIs:

    module ExtendCommand
      class Debug < Nop
        description "Load `debug` gem and starts a debugging session"
    
        banner <<~MSG
          Usage: debug
    
          This command loads the `debug` gem and start a debugging session at the current location.
          ....
        MSG
      end
    end
  2. Rename the current help command (showing API documents) to something else, like doc

    • In pry, byebug and debug, the help command are all used for showing command documents. So I think it's better to align with them.
  3. Support the new help command to list command documents:

    • help - list all available commands
      • If we follow what pry or byebug do, we only display commands' descriptions.
      • If we follow debug, we'll display full documentation for all commands. So in this case we won't need the description attribute.
      • Question: this means we'll be loading command classes by default. Is this a good reason to do that?
    • help <cmd> - display individual commands' full usage (banner).

Since this will be a breaking change (renaming a command), we'll need to bump the version that includes this feature to 2.0.

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