oclif / command

oclif base command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help output does not show subcommands when invoked via -h

mattwiller opened this issue ยท comments

Given a multi-command CLI with the following structure:

bin/
    run
src/
    commands/
        toplevel/
            index.js
            subcommand.js
    index.js

Running ./bin/run toplevel --help will display the subcommand in the help message:

COMMANDS
  toplevel:subcommand  Describe the command here

However, running ./bin/run toplevel -h does not display the subcommand in its help message. The section is omitted.

This appears to be because the help message is displayed via two separate code paths; running the command with --help calls into Main#_help() and using -h calls into Command#_help(). Why are there two methods that do different things for command help?

commented

It might be possible to consolidate, but the reason there is separate logic is that one displays help for an entered argv input (which could be something like heroku help apps or heroku apps --help). The other one is for displaying the help once we know what the command is going to be.

This is definitely a bug though. The subcommands should always be listed under -h.

๐ŸŽ‰ This issue has been resolved in version 1.5.5 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€