tj/commander.js — pull request #277 by whitlockjc (2014-10-20 21:21:45+00:00)
Title: Add support for variadic arguments

This is a quick attempt at fixing issue #53. It works by allowing the user to mark the last argument as variadic by appending `...` to the argument name. Here is an example: `.command('mycommand [variadicArg...]')`. If you attempt to mark an argument as variadic but it is not the last argument, you will get an error. Here is an example: `.command('mycommand [nonVariadicArg]')`. _(As I type out this message, I realize it could be possible to get fancy and allow commingling of variadic and regular arguments where possible but it would get pretty tricky and I think this is a good start.)_

Also, whenever the `action` is called, the arguments are proper such that the variadic argument is an `Array` of arguments. So if I were to invoke my command like this `node myapp mycommand arg0 arg1 arg2 arg3`, my action function signature could look like this `function (requiredArg, variadicArg)` and `requiredArg` would have a value of `'arg0'` while `variadicArg` would have a value of `['arg1', 'arg2', 'arg3']`. `program.args` is also proper such that its value would be this: `['arg0', ['arg1', 'arg2', 'arg3'], [Object object]` where the last argument is the program itself.

Fixes #53