Pull requests

#1 Merged
Repository
chrisdeely chrisdeely
Branch
default
Repository
mazzarelli mazzarelli
Branch
default

Support for multiple values for an option

Author
  1. chrisdeely
Reviewers
Description

Hi Joey, great work on this project. I had a need for multiple values for a single option, so I added some code to accomplish that task.

var opts = require('opts'); opts.parse([ { short:'m', description: 'accepts multiple values', value: true, multiple: true, callback: function(valueArray) { for(var i=0;i<valueArray.length; i++){ puts(i +"="+valueArray[i]); } }, { long: 'opt2'} ] );

//sample command line node myScript.js -m one two three -opt2

Let me know what you think!

Comments (0)