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

Function main_hook_options

src/main.c:1720–1747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1718}
1719
1720static bool main_hook_options(int argc, char **argv, const char **event_out,
1721 const char **dialect_out) {
1722 if (!argv || !event_out || !dialect_out) {
1723 return false;
1724 }
1725 *event_out = NULL;
1726 *dialect_out = NULL;
1727 int hook_index = -1;
1728 for (int index = 1; index < argc; index++) {
1729 if (argv[index] && strcmp(argv[index], "hook-augment") == 0) {
1730 hook_index = index;
1731 break;
1732 }
1733 }
1734 if (hook_index < 0) {
1735 return false;
1736 }
1737 for (int index = hook_index + 1; index < argc; index++) {
1738 if (strcmp(argv[index], "--event") == 0 && index + 1 < argc) {
1739 *event_out = argv[++index];
1740 } else if (strcmp(argv[index], "--dialect") == 0 && index + 1 < argc) {
1741 *dialect_out = argv[++index];
1742 } else {
1743 return false;
1744 }
1745 }
1746 return cbm_hook_augment_invocation_supported(*event_out, *dialect_out);
1747}
1748
1749enum {
1750 MAIN_DAEMON_CTL_PROBE_TIMEOUT_MS = 3000,

Callers 1

mainFunction · 0.85

Tested by

no test coverage detected