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:3318–3336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

Tested by

no test coverage detected