MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / _inject_init_db_default

Function _inject_init_db_default

cmd_arg/arg.py:121–136  ·  view source on GitHub ↗

Ensure bare --init_db defaults to sqlite for backward compatibility.

(args: Sequence[str])

Source from the content-addressed store, hash-verified

119
120
121def _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
139def _normalize_tieba_note_id(value: str) -> str:

Callers 1

parse_cmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected