MCPcopy Create free account
hub / github.com/1jehuang/jcode / first_non_option

Function first_non_option

scripts/jcode_memory_snapshot.py:98–110  ·  view source on GitHub ↗
(argv: list[str])

Source from the content-addressed store, hash-verified

96
97
98def first_non_option(argv: list[str]) -> str | None:
99 skip_next = False
100 for arg in argv[1:]:
101 if skip_next:
102 skip_next = False
103 continue
104 if arg in {"--socket", "--resume", "-C", "--chdir", "--model", "--provider"}:
105 skip_next = True
106 continue
107 if arg.startswith("-"):
108 continue
109 return arg
110 return None
111
112
113def classify_process(argv: list[str], cmd: str, main_socket: str) -> tuple[str | None, bool]:

Callers 1

classify_processFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected