Skip to content

Commit

Permalink
Show plugins list sorted alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
GreLI committed Mar 8, 2016
1 parent 02c24c9 commit 57dc9ae
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/svgo/coa.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,18 +555,16 @@ function optimizeFolder(dir, config, output) {

var showAvailablePlugins = function () {

var svgo = new SVGO();
var svgo = new SVGO(),
// Flatten an array of plugins grouped per type and sort alphabetically
list = Array.prototype.concat.apply([], svgo.config.plugins).sort(function(a, b) {
return a.name > b.name ? 1 : -1;
});;

console.log('Currently available plugins:');

svgo.config.plugins.forEach(function (plugins) {

plugins.forEach(function (plugin) {

console.log(' [ ' + plugin.name.green + ' ] ' + plugin.description);

});

list.forEach(function (plugin) {
console.log(' [ ' + plugin.name.green + ' ] ' + plugin.description);
});

//console.log(JSON.stringify(svgo, null, 4));
Expand Down

0 comments on commit 57dc9ae

Please sign in to comment.