add end of command options to sanitize user prompt (#130)

The PR should address the issue where user prompt maybe treated as a
option with leading `-`
Assuming `claude` does follow POSIX standard, the `--` option should
solve the issue.

fixes #129
This commit is contained in:
8519mark 2025-08-30 10:09:01 +09:00 committed by GitHub
parent a801a33086
commit ea7e86714f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -157,7 +157,7 @@ class SubprocessCLITransport(Transport):
cmd.extend(["--input-format", "stream-json"])
else:
# String mode: use --print with the prompt
cmd.extend(["--print", str(self._prompt)])
cmd.extend(["--print", "--", str(self._prompt)])
return cmd