fix(cli): restore is_flag=False + flag_value on --cwd option

Reverts an earlier incorrect cleanup: click.option with
is_flag=False + flag_value="." is valid click syntax that
allows --cwd to work both with and without an argument:

  --cwd              → cwd="." (current directory)
  --cwd /path        → cwd="/path"
  --cwd=.            → cwd="."
  --cwd --flag       → cwd=".", flag=True (correctly parsed)

Without these parameters, --cwd requires a value and
--dangerously-skip-permissions would be misread as the cwd.
This commit is contained in:
Zhengshou Lai
2026-05-27 11:23:14 +08:00
parent b580eecc43
commit 75eaabbfb5
+2
View File
@@ -37,6 +37,8 @@ def _resolve_chat_cwd() -> Path:
@click.option(
"--cwd",
"-C",
is_flag=False,
flag_value=".",
default=None,
type=click.Path(dir_okay=True, file_okay=False),
help="Use specified path as working directory (default: workspace/).",