( shell: string, program: CommanderCommand, )
| 586 | } |
| 587 | |
| 588 | function generateCompletionScript( |
| 589 | shell: string, |
| 590 | program: CommanderCommand, |
| 591 | ): string { |
| 592 | const normalized = shell.trim().toLowerCase() |
| 593 | if (normalized === 'bash') { |
| 594 | return generateBashCompletion(program) |
| 595 | } |
| 596 | if (normalized === 'zsh') { |
| 597 | return generateZshCompletion(program) |
| 598 | } |
| 599 | if (normalized === 'fish') { |
| 600 | return generateFishCompletion(program) |
| 601 | } |
| 602 | throw new Error(`Unsupported shell "${shell}". Expected bash, zsh, or fish.`) |
| 603 | } |
| 604 | |
| 605 | export async function logHandler(logId?: string | number): Promise<void> { |
| 606 | try { |
no test coverage detected