stop_early.js 312 B

1234567891011121314151617
  1. 'use strict';
  2. var parse = require('../');
  3. var test = require('tape');
  4. test('stops parsing on the first non-option when stopEarly is set', function (t) {
  5. var argv = parse(['--aaa', 'bbb', 'ccc', '--ddd'], {
  6. stopEarly: true,
  7. });
  8. t.deepEqual(argv, {
  9. aaa: 'bbb',
  10. _: ['ccc', '--ddd'],
  11. });
  12. t.end();
  13. });