mirror of
https://github.com/NCBM/plyngent.git
synced 2026-11-07 15:37:55 +08:00
core/tools+cli/display: name the trash in the delete confirm
The box asked "delete path 'x'", which reads as final even now that it is not. It now says "move path 'x' to the system trash" — and "delete path 'x' permanently" when the path really is destroyed: an explicit `permanent=true`, a host that turned `[trash] enabled` off, or a scratch path under the OS temporary directory. The classifier resolves the path to answer that, and falls back to the trash wording when path policy will refuse the call anyway. The pretty line follows: a delete that landed in the trash prints `(to trash)` instead of `(done)`, so a session's transcript still shows which deletes could be undone.
This commit is contained in:
@@ -657,6 +657,12 @@ async def test_pretty_mutators(capsys: pytest.CaptureFixture[str]) -> None:
|
||||
),
|
||||
("move_path", '{"src": "src", "dst": "dst"}', "moved directory src -> dst", "* Move 'src' → 'dst' (done)"),
|
||||
("delete_path", '{"path": "tmp/x.txt"}', "deleted file tmp/x.txt", "* Delete 'tmp/x.txt' (done)"),
|
||||
(
|
||||
"delete_path",
|
||||
'{"path": "tmp/x.txt"}',
|
||||
"deleted file tmp/x.txt (moved to system trash)",
|
||||
"* Delete 'tmp/x.txt' (to trash)",
|
||||
),
|
||||
]
|
||||
for name, args, content, expected in cases:
|
||||
await render_events(_aiter([_pretty_call(name, args), _result(content)]))
|
||||
|
||||
Reference in New Issue
Block a user