Sha256: 3fd5f504a5b18db2fc71b8bd1ef6f8ef218ed40064ec83c5ed650c475ffbeb84

Contents?: true

Size: 980 Bytes

Versions: 451

Compression:

Stored size: 980 Bytes

Contents

var parse = require('../');
var test = require('tape');

test('-', function (t) {
    t.plan(5);
    t.deepEqual(parse([ '-n', '-' ]), { n: '-', _: [] });
    t.deepEqual(parse([ '-' ]), { _: [ '-' ] });
    t.deepEqual(parse([ '-f-' ]), { f: '-', _: [] });
    t.deepEqual(
        parse([ '-b', '-' ], { boolean: 'b' }),
        { b: true, _: [ '-' ] }
    );
    t.deepEqual(
        parse([ '-s', '-' ], { string: 's' }),
        { s: '-', _: [] }
    );
});

test('-a -- b', function (t) {
    t.plan(3);
    t.deepEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] });
    t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
    t.deepEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
});

test('move arguments after the -- into their own `--` array', function(t) {
    t.plan(1);
    t.deepEqual(
        parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }),
        { name: 'John', _: [ 'before' ], '--': [ 'after' ] });
});

Version data entries

451 entries across 236 versions & 33 rubygems

Version Path
boring_generators-0.15.0 tmp/templates/app_template/node_modules/minimist/test/dash.js
boring_generators-0.14.0 tmp/templates/app_template/node_modules/minimist/test/dash.js
optimacms-0.1.61 spec/dummy/node_modules/minimist/test/dash.js
boring_generators-0.13.0 tmp/templates/app_template/node_modules/minimist/test/dash.js
boring_generators-0.12.0 tmp/templates/app_template/node_modules/minimist/test/dash.js
disco_app-0.18.0 test/dummy/node_modules/minimist/test/dash.js
disco_app-0.18.0 test/dummy/node_modules/fsevents/node_modules/rc/node_modules/minimist/test/dash.js
disco_app-0.18.2 test/dummy/node_modules/minimist/test/dash.js
trusty-cms-5.0.7 node_modules/minimist/test/dash.js
trusty-cms-5.0.6 node_modules/minimist/test/dash.js
trusty-cms-5.0.5 node_modules/minimist/test/dash.js
trusty-cms-5.0.4 node_modules/minimist/test/dash.js
disco_app-0.16.1 test/dummy/node_modules/@babel/core/node_modules/minimist/test/dash.js
disco_app-0.16.1 test/dummy/node_modules/minimist/test/dash.js
disco_app-0.16.1 test/dummy/node_modules/sass-loader/node_modules/minimist/test/dash.js
disco_app-0.16.1 test/dummy/node_modules/file-loader/node_modules/minimist/test/dash.js
disco_app-0.16.1 test/dummy/node_modules/style-loader/node_modules/minimist/test/dash.js
disco_app-0.16.1 test/dummy/node_modules/portfinder/node_modules/minimist/test/dash.js
disco_app-0.16.1 test/dummy/node_modules/webpack/node_modules/minimist/test/dash.js
disco_app-0.15.2 test/dummy/node_modules/file-loader/node_modules/minimist/test/dash.js