Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Help output does not show subcommands when invoked via -h #49

Closed
mattwiller opened this issue Nov 9, 2018 · 2 comments · Fixed by #50
Closed

Help output does not show subcommands when invoked via -h #49

mattwiller opened this issue Nov 9, 2018 · 2 comments · Fixed by #50
Labels
bug Something isn't working

Comments

@mattwiller
Copy link

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?

@jdx
Copy link
Contributor

jdx commented Nov 9, 2018

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.

@jdx jdx added the bug Something isn't working label Nov 9, 2018
@jdx jdx closed this as completed in #50 Nov 12, 2018
@oclif-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.5.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants