stop_early.js 328 B

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