(commandOptions, rawArgs)
| 29 | }, |
| 30 | |
| 31 | _printHelp(commandOptions, rawArgs) { |
| 32 | let rootCommand = new RootCommand({ |
| 33 | ui: this.ui, |
| 34 | project: this.project, |
| 35 | commands: this.commands, |
| 36 | tasks: this.tasks, |
| 37 | }); |
| 38 | |
| 39 | if (rawArgs.length === 0) { |
| 40 | this.ui.writeLine(rootCommand.printBasicHelp(commandOptions)); |
| 41 | // Display usage for all commands. |
| 42 | this.ui.writeLine('Available commands in ember-cli:'); |
| 43 | this.ui.writeLine(''); |
| 44 | |
| 45 | Object.keys(this.commands).forEach(function (commandName) { |
| 46 | this._printHelpForCommand(commandName, false, commandOptions); |
| 47 | }, this); |
| 48 | |
| 49 | if (this.project.eachAddonCommand) { |
| 50 | this.project.eachAddonCommand((addonName, commands) => { |
| 51 | this.commands = commands; |
| 52 | |
| 53 | this.ui.writeLine(''); |
| 54 | this.ui.writeLine(`Available commands from ${addonName}:`); |
| 55 | |
| 56 | Object.keys(this.commands).forEach(function (commandName) { |
| 57 | this._printHelpForCommand(commandName, false, commandOptions); |
| 58 | }, this); |
| 59 | }); |
| 60 | } |
| 61 | } else { |
| 62 | // If args were passed to the help command, |
| 63 | // attempt to look up the command for each of them. |
| 64 | |
| 65 | this.ui.writeLine('Requested ember-cli commands:'); |
| 66 | this.ui.writeLine(''); |
| 67 | |
| 68 | if (this.project.eachAddonCommand) { |
| 69 | this.project.eachAddonCommand((addonName, commands) => { |
| 70 | Object.assign(this.commands, commands); |
| 71 | }); |
| 72 | } |
| 73 | |
| 74 | let multipleCommands = [GenerateCommand.prototype.name].concat(GenerateCommand.prototype.aliases); |
| 75 | if (multipleCommands.indexOf(rawArgs[0]) > -1) { |
| 76 | let command = rawArgs.shift(); |
| 77 | if (rawArgs.length > 0) { |
| 78 | commandOptions.rawArgs = rawArgs; |
| 79 | } |
| 80 | rawArgs = [command]; |
| 81 | } |
| 82 | |
| 83 | // Iterate through each arg beyond the initial 'help' command, |
| 84 | // and try to display usage instructions. |
| 85 | rawArgs.forEach(function (commandName) { |
| 86 | this._printHelpForCommand(commandName, true, commandOptions); |
| 87 | }, this); |
| 88 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…