diff --git a/lib/svgo/coa.js b/lib/svgo/coa.js index e01e45164..96214e18c 100644 --- a/lib/svgo/coa.js +++ b/lib/svgo/coa.js @@ -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));