Skip to content

Commit b042298

Browse files
committed
feat: allow for a sub command to be the default
1 parent 9a25598 commit b042298

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/nest-commander/src/command-runner.service.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ ${cliPluginError(this.options.cliName ?? 'nest-commander', this.options.pluginsA
150150
);
151151
const subCommands = await this.populateCommandMapInstances(subCommandsMetaForCommand);
152152
for (const subCommand of subCommands) {
153-
newCommand.addCommand(await this.buildCommand(subCommand));
153+
newCommand.addCommand(await this.buildCommand(subCommand), {
154+
isDefault: subCommand.command.options?.isDefault ?? false,
155+
});
154156
}
155157
}
156158
return newCommand;

0 commit comments

Comments
 (0)