Skip to content

Commit f2f714c

Browse files
fix: CLI should print help of commands with dash in the name
When trying to print the help of a default hierarchical command, CLI expects the format of the command name to be `<letters>|*<something else>`. However, some commands have dash in the name, like `tns package-manager get`. Fix the expectation of the help service.
1 parent e0194cd commit f2f714c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/common/services/help-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export class HelpService implements IHelpService {
183183

184184
private async convertCommandNameToFileName(commandData: ICommandData): Promise<string> {
185185
let { commandName } = commandData;
186-
const defaultCommandMatch = commandName && commandName.match(/(\w+?)\|\*/);
186+
const defaultCommandMatch = commandName && commandName.match(/([\w-]+?)\|\*/);
187187
if (defaultCommandMatch) {
188188
this.$logger.trace("Default command found. Replace current command name '%s' with '%s'.", commandName, defaultCommandMatch[1]);
189189
commandName = defaultCommandMatch[1];

0 commit comments

Comments
 (0)