Skip to content

Commit

Permalink
Skip camelcasing -- option
Browse files Browse the repository at this point in the history
Fixes #33.
  • Loading branch information
kevva committed Apr 11, 2016
1 parent 94a36b8 commit cfbff9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ module.exports = function (opts, minimistOpts) {

return {
input: _,
flags: camelcaseKeys(argv),
flags: camelcaseKeys(argv, {exclude: ['--']}),
pkg: pkg,
help: help,
showHelp: showHelp
Expand Down
8 changes: 5 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@ global.Promise = Promise;

test('return object', t => {
const cli = fn({
argv: ['foo', '--foo-bar', '-u', 'cat'],
argv: ['foo', '--foo-bar', '-u', 'cat', '--', 'unicorn', 'cake'],
help: [
'Usage',
' foo <input>'
]
}, {
alias: {u: 'unicorn'},
default: {meow: 'dog'}
'alias': {u: 'unicorn'},
'default': {meow: 'dog'},
'--': true
});

t.is(cli.input[0], 'foo');
t.true(cli.flags.fooBar);
t.is(cli.flags.meow, 'dog');
t.is(cli.flags.unicorn, 'cat');
t.deepEqual(cli.flags['--'], ['unicorn', 'cake']);
t.is(cli.pkg.name, 'meow');
t.is(cli.help, indentString('\nCLI app helper\n\nUsage\n foo <input>\n', ' '));
});
Expand Down

0 comments on commit cfbff9c

Please sign in to comment.