From 36fe45e3a4a7ce9b61ab7bf2df07f0132a9170c1 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 04:58:25 -0300 Subject: `--` ends pardes's options: `pardes -- -dash.txt` opens the file named -dash.txt It said `no such option: --`. What follows `--` is a name, one at most, as for any other positional. Co-Authored-By: Claude Opus 5.5 --- test/fs.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/fs.py b/test/fs.py index f24e2550..6c6bcbef 100644 --- a/test/fs.py +++ b/test/fs.py @@ -989,6 +989,7 @@ def test(binary, quic=False): for options, message in [ (['--fs'], b'no such option'), (['--fs9'], b'no such option'), + (['--', 'a', 'b'], b'is the second'), (['--9p'], b'--9p needs a socket name'), (['--9p='], b'invalid 9P socket name'), (['--9p=a/b'], b'invalid 9P socket name'), @@ -1396,6 +1397,14 @@ def test(binary, quic=False): assert time.monotonic() - deleted < .05, time.monotonic() - deleted assert second.wait(timeout=5) == 0 assert edited.read_bytes() == b'edited\n' + # `--` ends the options: a name starting with a dash is a name. + dash = root / '-dash.txt' + dash.write_bytes(b'dash\n') + before = serials() + assert subprocess.run([binary, '--', dash.name], cwd=root, env=env, capture_output=True, timeout=10).returncode == 0 + dashed, = serials() - before + assert client.read(f'/pane/{dashed}/name').rstrip(b'\n') == str(dash).encode() + client.remove(f'/pane/{dashed}') # --wait waits on the pane its look answered, on the look's own # open: a name /index shows escaped (a backslash is `\\` there) # is still the pane waited on, not one already gone. -- cgit v1.3