yargs / yargs/yargs-parser

Specifying both `count` and `boolean` should throw error

Open
#216 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature help wanted
Dominant language
JavaScript
Stars
519
Forks
129
Avg merge
1h 34m
Merged PRs (30d)
1

Description

As discussed in yargs/yargs#256, specifying both count and boolean is a programming error. yargs should throw an exception, or at the very least print a warning. If printing a warning is chosen, the default count should be 0 instead of 2 (as is currently the case).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how yargs-parser handles option definitions that specify both count and boolean, then inspect the existing tests for option validation. Done means the conflicting configuration raises an exception, or emits a warning while using a default count of 0.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.