(argv: list[str])
| 96 | |
| 97 | |
| 98 | def 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 | |
| 113 | def classify_process(argv: list[str], cmd: str, main_socket: str) -> tuple[str | None, bool]: |