Skip to content

strictOptions with 'strip-aliased' doesn't work with a capitalize option #315

@fcastilloec

Description

@fcastilloec

As reported in yargs/yargs#1701, using yargs@next with the new strictOptions is not working correctly when using a capitalize alias and setting parserConfiguration({ 'strip-aliased': true }). Here's some working code to reproduce the bug:

yargs(['foo', '-a'])
  .parserConfiguration({ 'strip-aliased': true })
  .strictOptions()
  .option('and', { alias: 'A' })
  .parse();

If you set 'strip-aliased': false then it fails as it should.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions