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

Function select_update_variant

src/cli/cli.c:11400–11425  ·  view source on GitHub ↗

Select update variant. Returns 0=standard, 1=ui, -1=error. */

Source from the content-addressed store, hash-verified

11398
11399/* Select update variant. Returns 0=standard, 1=ui, -1=error. */
11400static int select_update_variant(int variant_flag) {
11401 if (variant_flag == VARIANT_A) {
11402 return 0;
11403 }
11404 if (variant_flag == VARIANT_B) {
11405 return CLI_TRUE;
11406 }
11407#ifndef _WIN32
11408 if (!isatty(fileno(stdin))) {
11409 (void)fprintf(stderr, "error: variant selection requires a terminal. "
11410 "Use --standard or --ui flag.\n");
11411 return CLI_ERR;
11412 }
11413#endif
11414 printf("Which binary variant do you want?\n");
11415 printf(" 1) standard — MCP server only\n");
11416 printf(" 2) ui — MCP server + embedded graph visualization\n");
11417 printf("Choose (1/2): ");
11418 (void)fflush(stdout);
11419 char choice[CLI_BUF_16];
11420 if (!fgets(choice, sizeof(choice), stdin)) {
11421 (void)fprintf(stderr, "error: failed to read input\n");
11422 return CLI_ERR;
11423 }
11424 return (choice[0] == '2') ? CLI_TRUE : 0;
11425}
11426
11427/* Case-insensitive prefix match (portable — no strncasecmp dependency). */
11428static bool prefix_icase(const char *s, const char *prefix) {

Callers 1

cbm_cmd_updateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected