(command: Command)
| 88 | * For example: 'change show' -> 'change:show' |
| 89 | */ |
| 90 | export function getCommandPath(command: Command): string { |
| 91 | const names: string[] = []; |
| 92 | let current: Command | null = command; |
| 93 | |
| 94 | while (current) { |
| 95 | const name = current.name(); |
| 96 | // Skip the root 'openspec' command |
| 97 | if (name && name !== 'openspec') { |
| 98 | names.unshift(name); |
| 99 | } |
| 100 | current = current.parent; |
| 101 | } |
| 102 | |
| 103 | return names.join(':') || 'openspec'; |
| 104 | } |
| 105 | |
| 106 | program |
| 107 | .name('openspec') |
no outgoing calls
no test coverage detected