Ensure bare --init_db defaults to sqlite for backward compatibility.
(args: Sequence[str])
| 119 | |
| 120 | |
| 121 | def _inject_init_db_default(args: Sequence[str]) -> list[str]: |
| 122 | """Ensure bare --init_db defaults to sqlite for backward compatibility.""" |
| 123 | |
| 124 | normalized: list[str] = [] |
| 125 | i = 0 |
| 126 | while i < len(args): |
| 127 | arg = args[i] |
| 128 | normalized.append(arg) |
| 129 | |
| 130 | if arg == "--init_db": |
| 131 | next_arg = args[i + 1] if i + 1 < len(args) else None |
| 132 | if not next_arg or next_arg.startswith("-"): |
| 133 | normalized.append(InitDbOptionEnum.SQLITE.value) |
| 134 | i += 1 |
| 135 | |
| 136 | return normalized |
| 137 | |
| 138 | |
| 139 | def _normalize_tieba_note_id(value: str) -> str: |