Skip to content

Don't Show options when there are no options #689

@mateodelnorte

Description

@mateodelnorte

The simplest possible executable with a single command and no options still forces showing of options:

const program = require('commander');

program
  .command('cmd', 'a single cmd with no options')

program
  .parse(process.argv);

yields:

./bin/my-cmd

  Usage: my-cmd [options] [command]


  Options:

    -h, --help  output usage information


  Commands:

    cmd         a single cmd with no options
    help [cmd]  display help for [cmd]

Why show options here? Help is already redundant, and the resulting UI is less usable because the intended call to action obscured by a big in-your-face prompt about -h.

Can we allow setting a property to now show options?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions