greedy arrays seems not work
Open
Nobody has claimed this yet.
question
- Dominant language
- JavaScript
- Stars
- 519
- Forks
- 129
- Avg merge
- 1h 34m
- Merged PRs (30d)
- 1
Description
const parser = require('yargs-parser')
const args = parser(process.argv.slice(2), {
//array: ['foo'],
configuration: {
"greedy-arrays": true
}
})
console.log(args);
]$ v-cli --foo apple banana cat
{ _: [ 'banana', 'cat' ], foo: 'apple' }
how to get { _: [ ], foo: ['apple', 'banana', 'cat' ] } Instead of specifying array: ['foo'],
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 running the provided yargs-parser reproduction with configuration set to greedy-arrays and compare it with the explicit array option. Trace how positional values are assigned when greedy-arrays is enabled. Done means the shown command produces an empty _ array and places all three values in foo, without requiring array: ['foo'].
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100