* @private * @method callHelp * @param options * @return {Promise}
(options)
| 216 | * @return {Promise} |
| 217 | */ |
| 218 | callHelp(options) { |
| 219 | let environment = options.environment; |
| 220 | let commandName = options.commandName; |
| 221 | let commandArgs = options.commandArgs; |
| 222 | let helpIndex = commandArgs.indexOf('--help'); |
| 223 | let hIndex = commandArgs.indexOf('-h'); |
| 224 | |
| 225 | let HelpCommand = lookupCommand(environment.commands, 'help', commandArgs, { |
| 226 | project: environment.project, |
| 227 | ui: this.ui, |
| 228 | }); |
| 229 | |
| 230 | let help = new HelpCommand({ |
| 231 | ui: this.ui, |
| 232 | commands: environment.commands, |
| 233 | tasks: environment.tasks, |
| 234 | project: environment.project, |
| 235 | settings: environment.settings, |
| 236 | testing: this.testing, |
| 237 | }); |
| 238 | |
| 239 | if (helpIndex > -1) { |
| 240 | commandArgs.splice(helpIndex, 1); |
| 241 | } |
| 242 | |
| 243 | if (hIndex > -1) { |
| 244 | commandArgs.splice(hIndex, 1); |
| 245 | } |
| 246 | |
| 247 | commandArgs.unshift(commandName); |
| 248 | |
| 249 | return help.validateAndRun(commandArgs); |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * @private |
no outgoing calls
no test coverage detected