stop_early.js 328 B

123456789101112131415
  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. });