2023-12-28 23:41:32 +08:00
|
|
|
'use strict';
|
|
|
|
|
2023-12-18 13:12:25 +08:00
|
|
|
var parse = require('../');
|
|
|
|
var test = require('tape');
|
|
|
|
|
|
|
|
test('stops parsing on the first non-option when stopEarly is set', function (t) {
|
2023-12-28 23:41:32 +08:00
|
|
|
var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], {
|
|
|
|
stopEarly: true,
|
|
|
|
});
|
2023-12-18 13:12:25 +08:00
|
|
|
|
2023-12-28 23:41:32 +08:00
|
|
|
t.deepEqual(argv, {
|
|
|
|
aaa: 'bbb',
|
|
|
|
_: ['ccc', '--ddd'],
|
|
|
|
});
|
2023-12-18 13:12:25 +08:00
|
|
|
|
2023-12-28 23:41:32 +08:00
|
|
|
t.end();
|
2023-12-18 13:12:25 +08:00
|
|
|
});
|