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

Source from the content-addressed store, hash-verified

3977}
3978
3979static int cbm_build_dialect_hook_command(const char *binary_path, const char *dialect,
3980 bool windows, char *command, size_t command_size,
3981 char *shell, size_t shell_size) {
3982 if (!shell || shell_size == 0U) {
3983 return CLI_ERR;
3984 }
3985 if (!windows) {
3986 shell[0] = '\0';
3987 return cbm_build_augment_dialect_command(binary_path, dialect, command, command_size);
3988 }
3989 int shell_written = snprintf(shell, shell_size, "%s", "powershell");
3990 char base[CLI_BUF_8K];
3991 if (shell_written < 0 || (size_t)shell_written >= shell_size ||
3992 cbm_build_augment_command_windows(binary_path, base, sizeof(base)) != CLI_OK) {
3993 return CLI_ERR;
3994 }
3995 int written = snprintf(command, command_size, "%s --dialect %s", base, dialect);
3996 return written > 0 && (size_t)written < command_size ? CLI_OK : CLI_ERR;
3997}
3998
3999/* Qwen exposes one command plus an optional shell selector. This helper keeps
4000 * platform selection explicit and testable without requiring a Windows host. */

Callers 2

Tested by

no test coverage detected