Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 115b8b2

Browse files
FatmeFatme
Fatme
authored and
Fatme
committed
Merge pull request #277 from telerik/fatme/sb-help
Help for ScreenBuidler commands
2 parents 3c1d60b + 96b66ff commit 115b8b2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

services/html-help-service.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export class HtmlHelpService implements IHtmlHelpService {
3434
private $fs: IFileSystem,
3535
private $staticConfig: Config.IStaticConfig,
3636
private $microTemplateService: IMicroTemplateService,
37-
private $opener: IOpener) {
37+
private $opener: IOpener,
38+
private $commandsServiceProvider: ICommandsServiceProvider) {
3839
this.pathToHtmlPages = this.$staticConfig.HTML_PAGES_DIR;
3940
this.pathToManPages = this.$staticConfig.MAN_PAGES_DIR;
4041
}
@@ -102,7 +103,10 @@ export class HtmlHelpService implements IHtmlHelpService {
102103
var availableCommands = this.$injector.getRegisteredCommandsNames(false).sort();
103104
this.$logger.trace("List of registered commands: %s", availableCommands.join(", "));
104105
if(commandName && !_.contains(availableCommands, commandName)) {
105-
this.$errors.failWithoutHelp("Unknown command '%s'. Try '$ %s help' for a full list of supported commands.", commandName, this.$staticConfig.CLIENT_NAME.toLowerCase());
106+
var dynamicCommands = this.$commandsServiceProvider.getDynamicCommands().wait();
107+
if(!_.contains(dynamicCommands, commandName)) {
108+
this.$errors.failWithoutHelp("Unknown command '%s'. Try '$ %s help' for a full list of supported commands.", commandName, this.$staticConfig.CLIENT_NAME.toLowerCase());
109+
}
106110
}
107111

108112
return commandName.replace(/\|/g, "-") || "index";

0 commit comments

Comments
 (0)