chore: simplify model flag handling
This commit is contained in:
@@ -359,23 +359,7 @@ def run(
|
||||
else:
|
||||
extra_args = shlex.split(str(raw_exec_args)) # e.g. "--full-auto --search"
|
||||
|
||||
def _strip_model_args(args: list[str]) -> list[str]:
|
||||
stripped: list[str] = []
|
||||
i = 0
|
||||
while i < len(args):
|
||||
arg = args[i]
|
||||
if arg in ("--model", "-m"):
|
||||
i += 2
|
||||
continue
|
||||
if arg.startswith("--model=") or arg.startswith("-m="):
|
||||
i += 1
|
||||
continue
|
||||
stripped.append(arg)
|
||||
i += 1
|
||||
return stripped
|
||||
|
||||
if model:
|
||||
extra_args = _strip_model_args(extra_args)
|
||||
extra_args.extend(["--model", model])
|
||||
|
||||
def _has_notify_override(args: list[str]) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user