| 3372 | } |
| 3373 | |
| 3374 | static int cbm_build_dialect_hook_command(const char *binary_path, const char *dialect, |
| 3375 | bool windows, char *command, size_t command_size, |
| 3376 | char *shell, size_t shell_size) { |
| 3377 | if (!shell || shell_size == 0U) { |
| 3378 | return CLI_ERR; |
| 3379 | } |
| 3380 | if (!windows) { |
| 3381 | shell[0] = '\0'; |
| 3382 | return cbm_build_augment_dialect_command(binary_path, dialect, command, command_size); |
| 3383 | } |
| 3384 | int shell_written = snprintf(shell, shell_size, "%s", "powershell"); |
| 3385 | char base[CLI_BUF_8K]; |
| 3386 | if (shell_written < 0 || (size_t)shell_written >= shell_size || |
| 3387 | cbm_build_augment_command_windows(binary_path, base, sizeof(base)) != CLI_OK) { |
| 3388 | return CLI_ERR; |
| 3389 | } |
| 3390 | int written = snprintf(command, command_size, "%s --dialect %s", base, dialect); |
| 3391 | return written > 0 && (size_t)written < command_size ? CLI_OK : CLI_ERR; |
| 3392 | } |
| 3393 | |
| 3394 | /* Qwen exposes one command plus an optional shell selector. This helper keeps |
| 3395 | * platform selection explicit and testable without requiring a Windows host. */ |
no test coverage detected