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

Function main_hook_options

src/main.c:2062–2089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2060}
2061
2062static bool main_hook_options(int argc, char **argv, const char **event_out,
2063 const char **dialect_out) {
2064 if (!argv || !event_out || !dialect_out) {
2065 return false;
2066 }
2067 *event_out = NULL;
2068 *dialect_out = NULL;
2069 int hook_index = -1;
2070 for (int index = 1; index < argc; index++) {
2071 if (argv[index] && strcmp(argv[index], "hook-augment") == 0) {
2072 hook_index = index;
2073 break;
2074 }
2075 }
2076 if (hook_index < 0) {
2077 return false;
2078 }
2079 for (int index = hook_index + 1; index < argc; index++) {
2080 if (strcmp(argv[index], "--event") == 0 && index + 1 < argc) {
2081 *event_out = argv[++index];
2082 } else if (strcmp(argv[index], "--dialect") == 0 && index + 1 < argc) {
2083 *dialect_out = argv[++index];
2084 } else {
2085 return false;
2086 }
2087 }
2088 return cbm_hook_augment_invocation_supported(*event_out, *dialect_out);
2089}
2090
2091enum {
2092 MAIN_DAEMON_CTL_PROBE_TIMEOUT_MS = 3000,

Callers 1

mainFunction · 0.85

Tested by

no test coverage detected