malxau / yori

Yori is a CMD replacement shell that supports backquotes, job control, and improves tab completion, file matching, aliases, command history, and more.
http://www.malsmith.net/yori/
MIT License
1.24k stars 31 forks source link

erase: Failed to remove files that begin with `--` #73

Closed codehz closed 3 years ago

codehz commented 3 years ago

repro:

mkdir a
explorer a
:: and manually create a file that begin with `--` like `--123`
del a

now it report erase: no matching files found

NOTICE: It can be remove by rmdir -s -q a

malxau commented 3 years ago

Anything starting with / or - is treated as a switch, not a file. The special switch -- is used to indicate there are no more options. Does this work if you do erase -- --123 ? This pattern was incorporated from GNU tools.

codehz commented 3 years ago

Anything starting with / or - is treated as a switch, not a file. The special switch -- is used to indicate there are no more options. Does this work if you do erase -- --123 ? This pattern was incorporated from GNU tools.

The problem is I'm not even use the file name in the arguments, I try to delete the parent folder (in this case, it's folder a)

malxau commented 3 years ago

Which version of Yori and which version of Windows are you using? I haven't been able to reproduce this on the combinations I've tried.

codehz commented 3 years ago

@malxau YoriLib version: 01.40 Yori shell version: 01.40 Build date: Nov 10 2020

Windows: Windows version: 10.0.21277 (unknown), AMD64 screenshots: image

malxau commented 3 years ago

In this screenshot, isn't --123 a folder? Erase is for files. Rmdir should remove it. In CMD, del will by default prompt for confirmation but then do nothing.