Sade parses past `--`
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
If an optional argument is defined sade will parse after --
import sade from 'sade'
sade('prog')
.command('build [config]').action(console.log)
.parse(['node', 'cli.js', 'build', '--', 'abc', 'xyz'])
Results in "abc", {_: ["xyz"]}
But I'd expect it to parse undefined, {_: ["abc', "xyz"]}
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 issue with the provided sade command and argument list. Trace how parse handles the -- marker when the command has an optional argument; done means the optional value is undefined and both abc and xyz remain in the positional _ array.
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
- Clearly specified
- Newbie friendliness
- 45/100