sade icon indicating copy to clipboard operation
sade copied to clipboard

[feature request] Command `--help` should show available subcommands

Open jsumners opened this issue 4 years ago • 0 comments

prog
  .command('foo')
  .describe('Top level command')
  .action(() => console.log('see `app foo --help`'))

prog
  .command('foo bar')
  .describe('A subcommand')
  .action(() => console.log('did a thing'))

Use case: the foo command doesn't do anything and requires usage of subcommands. As it is, doing app foo --help does not display any possible subcommands under the "Usage" section. Instead, one has to do app --help to see a potentially long list of available commands and subcommands. Ideally, app --help would show the foo command but not the foo bar command so that one would have to do app foo --help to see the available subcommands.

Side request: foo could do something, but it'd just be an alias of a required subcommand.

jsumners avatar Feb 28 '20 14:02 jsumners