diff --git a/src/index.ts b/src/index.ts index eb508589..b47c85ac 100644 --- a/src/index.ts +++ b/src/index.ts @@ -61,7 +61,7 @@ export default class Help { } else if (command = this.config.findCommand(subject)) { const name = command.id const depth = name.split(':').length - topics = topics.filter(t => t.name.startsWith(name) && t.name.split(':').length === depth + 1) + topics = topics.filter(t => t.name.startsWith(name + ':') && t.name.split(':').length === depth + 1) let title = command.description && this.render(command.description).split('\n')[0] if (title) console.log(title + '\n') console.log(this.command(command)) @@ -73,7 +73,7 @@ export default class Help { } else if (topic = this.config.findTopic(subject)) { const name = topic.name const depth = name.split(':').length - topics = topics.filter(t => t.name.startsWith(name) && t.name.split(':').length === depth + 1) + topics = topics.filter(t => t.name.startsWith(name + ':') && t.name.split(':').length === depth + 1) console.log(this.topic(topic)) if (topics.length) { console.log(this.topics(topics))