duojs/duo — pull request #405 by dominicbarnes (2014-12-05 01:00:02+00:00)
Title: Improving plugin usage in CLI

This adds the ability to use `--use` multiple times, while still allowing comma-separated lists for backwards compat.

```sh
# this
% duo --use duo-handlebars,duo-6to5,duo-myth ...

# can now be expressed as
% duo --use duo-handlebars --use duo-6to5 --use duo-myth ...

# or even
% duo --use duo-handlebars,duo-6to5 --use duo-myth
```

I've also allowed people to exclude the `.js` when including local modules, so given the dir structure:

* index.js
* plugin.js

```sh
# this
% duo --use plugin.js

# can now be expressed as
% duo --use plugin
```

Lastly, I've added one other behavior. This allows a module to export an `Array` of plugins, allowing the inclusion of many plugins with custom config much more easily. For example:

**plugins.js**
```js
var es6 = require('duo-6to5');
var hbs = require('duo-handlebars');
var myth = require('duo-myth');

module.exports = [
hbs(),
myth({
customMedia: false,
calc: false
}),
es6({
onlyLocals: true
})
];
```

```sh
% duo --use plugins index.{js,css}
```

I think this is a much better solution to the problem of configuring plugins, particularly in regards to the CLI. This would normalize the behavior in such a way that both the API and CLI can take the same argument and do the same thing.