Skip to content

Commit 441016d

Browse files
SwiftworkCopilot
andauthored
Update packages/cli/utils/commander.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f8f88a3 commit 441016d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

packages/cli/utils/commander.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { Command } from "commander";
22

33
export function commandName(command: Command) {
4-
if (
5-
command.parent &&
6-
command.parent.name() &&
7-
command.parent.name() !== "index"
8-
) {
9-
return `${command.parent.name()} ${command.name()}`;
4+
if (command.parent) {
5+
const parentName = command.parent.name();
6+
if (parentName && parentName !== "index") {
7+
return `${parentName} ${command.name()}`;
8+
}
109
}
1110
return command.name();
1211
}

0 commit comments

Comments
 (0)