(commandOptions)
| 17 | } |
| 18 | |
| 19 | generate(commandOptions) { |
| 20 | let rootCommand = new RootCommand({ |
| 21 | ui: this.ui, |
| 22 | project: this.project, |
| 23 | commands: this.commands, |
| 24 | tasks: this.tasks, |
| 25 | }); |
| 26 | |
| 27 | let json = rootCommand.getJson(commandOptions); |
| 28 | json.version = emberCLIVersion(); |
| 29 | json.commands = []; |
| 30 | json.addons = []; |
| 31 | |
| 32 | Object.keys(this.commands).forEach(function (commandName) { |
| 33 | this._addCommandHelpToJson(commandName, commandOptions, json); |
| 34 | }, this); |
| 35 | |
| 36 | if (this.project.eachAddonCommand) { |
| 37 | this.project.eachAddonCommand((addonName, commands) => { |
| 38 | this.commands = commands; |
| 39 | |
| 40 | let addonJson = { name: addonName }; |
| 41 | addonJson.commands = []; |
| 42 | json.addons.push(addonJson); |
| 43 | |
| 44 | Object.keys(this.commands).forEach(function (commandName) { |
| 45 | this._addCommandHelpToJson(commandName, commandOptions, addonJson); |
| 46 | }, this); |
| 47 | }); |
| 48 | } |
| 49 | |
| 50 | return json; |
| 51 | } |
| 52 | |
| 53 | _addCommandHelpToJson(commandName, options, json) { |
| 54 | let command = this._lookupCommand(commandName); |
no test coverage detected