MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_build_dialect_hook_command

Function cbm_build_dialect_hook_command

src/cli/cli.c:3312–3330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3310}
3311
3312static int cbm_build_dialect_hook_command(const char *binary_path, const char *dialect,
3313 bool windows, char *command, size_t command_size,
3314 char *shell, size_t shell_size) {
3315 if (!shell || shell_size == 0U) {
3316 return CLI_ERR;
3317 }
3318 if (!windows) {
3319 shell[0] = '\0';
3320 return cbm_build_augment_dialect_command(binary_path, dialect, command, command_size);
3321 }
3322 int shell_written = snprintf(shell, shell_size, "%s", "powershell");
3323 char base[CLI_BUF_8K];
3324 if (shell_written < 0 || (size_t)shell_written >= shell_size ||
3325 cbm_build_augment_command_windows(binary_path, base, sizeof(base)) != CLI_OK) {
3326 return CLI_ERR;
3327 }
3328 int written = snprintf(command, command_size, "%s --dialect %s", base, dialect);
3329 return written > 0 && (size_t)written < command_size ? CLI_OK : CLI_ERR;
3330}
3331
3332/* Qwen exposes one command plus an optional shell selector. This helper keeps
3333 * platform selection explicit and testable without requiring a Windows host. */

Callers 2

Tested by

no test coverage detected