diff --git a/lib/classes/CLI.js b/lib/classes/CLI.js index 687123003..88e22f13f 100644 --- a/lib/classes/CLI.js +++ b/lib/classes/CLI.js @@ -72,18 +72,19 @@ class CLI { return false; } - displayCommandUsage(commandObject, command) { + displayCommandUsage(commandObject, command, indents = 0) { const dotsLength = 30; // check if command has lifecycleEvents (can be executed) if (commandObject.lifecycleEvents) { const usage = commandObject.usage; const dots = _.repeat('.', dotsLength - command.length); - this.consoleLog(`${chalk.yellow(command)} ${chalk.dim(dots)} ${usage}`); + const indent = _.repeat(' ', indents); + this.consoleLog(`${indent}${chalk.yellow(command)} ${chalk.dim(dots)} ${usage}`); } _.forEach(commandObject.commands, (subcommandObject, subcommand) => { - this.displayCommandUsage(subcommandObject, `${command} ${subcommand}`); + this.displayCommandUsage(subcommandObject, `${command} ${subcommand}`, indents); }); } @@ -153,6 +154,14 @@ class CLI { this.consoleLog(''); this.consoleLog(chalk.yellow.underline('Commands by plugin')); + + this.consoleLog(''); + + _.forEach(this.loadedCommands, (details, command) => { + this.consoleLog(details.pluginName); + this.displayCommandUsage(details, command, 1); + this.consoleLog(''); + }); } generateCommandsHelp(commandsArray) {