Repository navigation
v2.0.0
⚠️ BREAKING CHANGES
Redesigned structure of return object with parsed elements
Example: cli.js --verbose file.txt -- one two
Old v1.x
Returns:
{
verbose: true,
_: ['file.txt', 'one', 'two'],
}New v2.x
Returns:
{
args: {}, // named positional arguments
flags: { verbose: true }, // parsed flags
_: ['file.txt'], // arguments before `--`
_tail: ['one', 'two'], // arguments after `--`
}✅ Features
- Added
argsoption for named positional arguments - Added support for variadic arguments (e.g.
...files) to collect last arguments into array - Added
booleanoption to treat flags as booleans without consuming values - Return property
_now contains only positional arguments before-- - Added return property
_tailto capture all arguments after--