diff --git a/src/js/sandbox/commands.js b/src/js/sandbox/commands.js index 24158874..3e04cf97 100644 --- a/src/js/sandbox/commands.js +++ b/src/js/sandbox/commands.js @@ -115,6 +115,20 @@ var instantCommands = [ }], [/^show +commands$/, function(bits) { var allCommands = getAllCommands(); + var allOptions = Commands.commands.getOptionMap(); + var commandToOptions = {}; + + Object.keys(allOptions).forEach(function(vcs) { + var vcsMap = allOptions[vcs]; + Object.keys(vcsMap).forEach(function(method) { + var options = vcsMap[method]; + if (options) { + commandToOptions[vcs + ' ' + method] = Object.keys(options).filter(option => option.length > 1); + } + }); + }); + + var lines = [ intl.str('show-all-commands'), '
' @@ -122,6 +136,9 @@ var instantCommands = [ Object.keys(allCommands) .forEach(function(command) { lines.push(command); + if (commandToOptions[command]) { + commandToOptions[command].forEach(option => lines.push('    ' + option)); + } }); throw new CommandResult({