Insert a sequence of --flag=value into argv, ensuring they are inserted before `--`.
(argv: list[str], flags: list[str])
| 270 | |
| 271 | |
| 272 | def _insert_flags(argv: list[str], flags: list[str]) -> list[str]: |
| 273 | """Insert a sequence of --flag=value into argv, ensuring they are inserted before `--`.""" |
| 274 | assert len(argv) > 0 and not argv[0].startswith("--"), "argv[0] should contain the program name" |
| 275 | i = len(_flags(argv)) |
| 276 | return argv[0:i] + flags + argv[i:] |
| 277 | |
| 278 | |
| 279 | def get_path(d: dict[str, Any], k: str, default: Optional[Any] = None) -> Optional[Any]: |