| 3532 | } |
| 3533 | |
| 3534 | static int cbm_build_dialect_hook_command(const char *binary_path, const char *dialect, |
| 3535 | bool windows, char *command, size_t command_size, |
| 3536 | char *shell, size_t shell_size) { |
| 3537 | if (!shell || shell_size == 0U) { |
| 3538 | return CLI_ERR; |
| 3539 | } |
| 3540 | if (!windows) { |
| 3541 | shell[0] = '\0'; |
| 3542 | return cbm_build_augment_dialect_command(binary_path, dialect, command, command_size); |
| 3543 | } |
| 3544 | int shell_written = snprintf(shell, shell_size, "%s", "powershell"); |
| 3545 | char base[CLI_BUF_8K]; |
| 3546 | if (shell_written < 0 || (size_t)shell_written >= shell_size || |
| 3547 | cbm_build_augment_command_windows(binary_path, base, sizeof(base)) != CLI_OK) { |
| 3548 | return CLI_ERR; |
| 3549 | } |
| 3550 | int written = snprintf(command, command_size, "%s --dialect %s", base, dialect); |
| 3551 | return written > 0 && (size_t)written < command_size ? CLI_OK : CLI_ERR; |
| 3552 | } |
| 3553 | |
| 3554 | /* Qwen exposes one command plus an optional shell selector. This helper keeps |
| 3555 | * platform selection explicit and testable without requiring a Windows host. */ |
no test coverage detected