| 3394 | } |
| 3395 | |
| 3396 | static int cbm_build_dialect_hook_command(const char *binary_path, const char *dialect, |
| 3397 | bool windows, char *command, size_t command_size, |
| 3398 | char *shell, size_t shell_size) { |
| 3399 | if (!shell || shell_size == 0U) { |
| 3400 | return CLI_ERR; |
| 3401 | } |
| 3402 | if (!windows) { |
| 3403 | shell[0] = '\0'; |
| 3404 | return cbm_build_augment_dialect_command(binary_path, dialect, command, command_size); |
| 3405 | } |
| 3406 | int shell_written = snprintf(shell, shell_size, "%s", "powershell"); |
| 3407 | char base[CLI_BUF_8K]; |
| 3408 | if (shell_written < 0 || (size_t)shell_written >= shell_size || |
| 3409 | cbm_build_augment_command_windows(binary_path, base, sizeof(base)) != CLI_OK) { |
| 3410 | return CLI_ERR; |
| 3411 | } |
| 3412 | int written = snprintf(command, command_size, "%s --dialect %s", base, dialect); |
| 3413 | return written > 0 && (size_t)written < command_size ? CLI_OK : CLI_ERR; |
| 3414 | } |
| 3415 | |
| 3416 | /* Qwen exposes one command plus an optional shell selector. This helper keeps |
| 3417 | * platform selection explicit and testable without requiring a Windows host. */ |
no test coverage detected