Alias single letter to negated boolean option
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 519
- Forks
- 129
- Avg merge
- 1h 34m
- Merged PRs (30d)
- 1
Description
I want to have --test set test: true but then also have an alias -T set test: false. Can I do this with yargs? I tried this:
> parser = require('yargs-parser')
> parser('-T', {alias: {T: 'no-test'}, boolean: ['test']})
{ _: [], T: true, 'no-test': true, noTest: true }
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the yargs-parser example with --test, -T, alias, and boolean options. Trace how aliases and negated boolean options are handled, then define the expected result: --test sets test to true while -T sets it to false, with tests covering both forms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100