Skip to content

requiredOption make --help invalid #1097

Description

@456wyc

when i set requiredOption on program, the --help will noneffective:

const program = new commander.Command()
program.version('0.0.1')
program
  .requiredOption('-d, --dir <path>', 'dir path')
  .option('-t, --timeout <number>', 'timeout')

when use -h, will get a error, but not the help info:

$ ./app.js -h
error: required option '-d, --dir <path>' not specified

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions