Skip to content

[Bug Report] Multiple words negated options #61

@meteorlxy

Description

@meteorlxy

Issue Type

  • Bug Report
  • Feature Request
  • Other

Steps to repro

// test.js
const cli = require('cac')();

cli.option('--no-aaa-bbb').option('--no-ccc');

const parsed = cli.parse();

console.log(JSON.stringify(parsed, null, 2));
$ node test.js
{
  "args": [],
  "options": {
    "--": [],
    "aaa-bbb": true,
    "ccc": true
  }
}

$ node test.js --no-aaa-bbb
{
  "args": [],
  "options": {
    "--": [],
    "aaa-bbb": true,
    "ccc": true,
    "aaaBbb": false
  }
}

$ node test.js --no-ccc
{
  "args": [],
  "options": {
    "--": [],
    "aaa-bbb": true,
    "ccc": false
  }
}

The "aaa-bbb": true is always there.

Info

  • CAC version: 6.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions